Skip to content

Commit

Permalink
version 1.2-1
Browse files Browse the repository at this point in the history
  • Loading branch information
Felipe de Mendiburu authored and gaborcsardi committed Sep 1, 2014
1 parent d4c8dbb commit f3972bc
Show file tree
Hide file tree
Showing 31 changed files with 781 additions and 513 deletions.
10 changes: 5 additions & 5 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
Package: agricolae
Type: Package
Title: Statistical Procedures for Agricultural Research
Version: 1.2-0
Date: 2014-06-30
Version: 1.2-1
Date: 2014-09-01
Author: Felipe de Mendiburu
Maintainer: Felipe de Mendiburu <f.mendiburu@cgiar.org>
Suggests: akima, klaR, MASS, nlme, cluster, spdep
Imports: klaR, MASS, nlme, cluster, spdep
Description: Agricolae was presented in the thesis "A statistical analysis tool for agricultural research" to obtain the degree of Master on science, mention Systems Engineering, Faculty of Industrial and Systems Engineering, National Engineering University (UNI), Lima-Peru. Original idea, support and data sets came from CIP (International Potato Center). Agricolae offers extensive functionality on experimental design especially for agricultural and plant breeding experiments, which can also be useful for other purposes. It supports planning of lattice, Alpha, Cyclic, Complete Block, Latin Square, Graeco-Latin Squares, augmented block, factorial, split and strip plot designs. There are also various analysis facilities for experimental data, e.g. treatment comparison procedures and several non-parametric tests comparison, biodiversity indexes and consensus cluster.
License: GPL
URL: http://tarwi.lamolina.edu.pe/~fmendiburu
Packaged: 2014-06-30 19:37:00 UTC; fdemendiburu
Packaged: 2014-09-01 15:18:40 UTC; fdemendiburu
NeedsCompilation: no
Repository: CRAN
Date/Publication: 2014-07-01 00:51:25
Date/Publication: 2014-09-01 17:45:19
50 changes: 26 additions & 24 deletions MD5
Original file line number Diff line number Diff line change
@@ -1,19 +1,20 @@
9bf6c9da14a832233973a59cfb5beeb5 *DESCRIPTION
dca209bf16efa5ac09feddc83c314cd5 *NAMESPACE
258576c2f7c922dc9692e2e1f5757045 *NEWS
afdacf8be33972790e04c123bad73827 *DESCRIPTION
951e1e7bcb98cc8667d10e9276b7f06d *NAMESPACE
7cd338801c939aa20960229712d309de *NEWS
b54a17fbcf6121f5bf49fc7674d43167 *R/AMMI.R
63bc79669decc3e830d4bc48db2f9b87 *R/AMMI.contour.R
6304e7483941b08750f5046d93ea713b *R/BIB.test.R
9b3e53ad358e1fe743195b4d06be384f *R/DAU.test.R
c0602badcc07f2c2892bf1704f61629b *R/HSD.test.R
4c396af8df2de01c8e2d84468f14ee18 *R/LSD.test.R
a0ec7e346b800ed7901f20ebb572541c *R/PBIB.test.r
b35337bd8d6d03ff788c56599c588927 *R/PBIB.test.r
8c67d91ca891d607605270db56b8724c *R/SNK.test.R
f9239c91888281358523cde344abaf3b *R/audpc.R
8c702bf4d28af150d4edd5b4d81c0d9f *R/audps.R
000a9d99e1fd0176f9be79abff2cfafc *R/bar.err.R
99a20c4d8a54834b071110ed1ad26768 *R/bar.group.R
8a5727dca117688179b2999008027ef7 *R/carolina.R
fb7b420d454122819738ebe35faba042 *R/consensus.R
d8ac865b0ed4443b8d28c1b5200c3e35 *R/consensus.R
d2eabb6c561d9773bfebcd1c11ae8f2b *R/correl.R
5c400f72110136a97ffeaa8a07a8dd04 *R/correlation.R
1e2e0f4b222b22e0cd73e885cc92fe5c *R/cv.model.R
Expand All @@ -31,15 +32,16 @@ c8bd1ff295093a4a8fcf0b23879d296f *R/design.lsd.R
85160deba77be3b8945436a8e3407eec *R/design.rcbd.R
b389b8a174cfcf95ce62b86afc85d48b *R/design.split.R
e611d280b0417ce22f14fcb6eed0eca6 *R/design.strip.R
d82eb7b6f9b411a88217505b61957fdd *R/design.youden.r
cb1ad92c3511f103a203d0c6d1253880 *R/duncan.test.r
f12f07bfe099f29f71b001f15b67ecb9 *R/durbin.test.R
342ec070103f2cea849f16e67405e759 *R/friedman.R
7ab088881c9deaa1df8b668a04b809fe *R/graph.freq.R
c78890976271a2feb91e9a2b3eddd40c *R/grid3p.R
e2362a1e694e883a567dd1f173d19525 *R/hcut.R
3cf607a30269cf57b6a939c6d2d7e299 *R/hgroups.R
a1d4da2c1b53f70adede38b0d317cfb5 *R/index.bio.R
b6aa6c034d4993c6fe74da578ec2f474 *R/index.smith.R
5eda9616c6903a4e10aac2094106437d *R/indexAMMI.r
114d6052191a4bccca362deae767564c *R/intervals.freq.R
871a527b72170b7f14028dc951d0b084 *R/join.freq.R
b6203baf64a53238a80450b7f087ad79 *R/kendall.R
Expand All @@ -57,7 +59,7 @@ d3965427438791b7ab400c2e456399d8 *R/order.group.R
87fd0291ed06c27510dfb28bf5f54de2 *R/order.stat.R
7d2166dd46e32dccda43fd1124a06acf *R/path.analysis.R
51fa32e7bfe36a383260758a2e8f4567 *R/plot.graph.freq.R
7df108ac7a9b35984ac51f035107adff *R/plotAMMI.r
dfc0faa94f65785a143b377e287d66b3 *R/plotAMMI.r
33510c05a613f6bf250e98203f1079a5 *R/polygon.freq.R
8e136196ddb74e2e0d9dcfabcbc54c49 *R/reg.homog.R
79f5d456dabed74f3aadbb9a787d7efc *R/resampling.cv.R
Expand All @@ -81,9 +83,8 @@ fa64c3292ec57a5457203976be62b0b6 *R/waerden.test.R
52f800d6c62727f3d1ec4dc2daedf5a6 *R/waller.R
dc7b3e8fd01a7298068c21d85f2f07ca *R/waller.test.R
995b006d6389bd2f9730040f140738f4 *R/weatherSeverity.r
1845e24b5bc2de19bbfe2dd1ec255f1c *R/wxyz.R
76ac793da04abfefbc5e641ac9f6a485 *R/zigzag.r
9cb282865fed53f1c1877dab186a7c98 *build/vignette.rds
245b8cd8e995b846f0bce1ad6948bf74 *R/zigzag.r
c51db392c58cd7622311824c1563cac2 *build/vignette.rds
3edde456b8a76e65f36c62888d86c78c *data/CIC.rda
a5ad58e54034bbdbc9918b6e0b6aae4e *data/Chz2006.rda
e4bdfaf49c1882e1f188a1f33588484b *data/ComasOxapampa.rda
Expand Down Expand Up @@ -119,13 +120,13 @@ ec644fe2f1fb85a8d096cc5b61888ddd *data/sinRepAmmi.rda
f89bebe0b89dcc945e5d4850104f5570 *data/sweetpotato.rda
93feb78eface8720dbdeff6d343a39e2 *data/wilt.rda
06d77e44fb004716afa58983e3c0ff08 *data/yacon.rda
1cd8f2e93015eedf59f7c6e79ee81f2e *inst/doc/tutorial.R
45f7398d79ca4b03f8f3d57ff68a058f *inst/doc/tutorial.Rnw
ee0f28f3e158c1dc2d0b3ac46d987ea0 *inst/doc/tutorial.pdf
25ace02052a165d490f381a73fdd4f86 *inst/doc/tutorial.R
8ff96b7731ea7eb28060fd172e3257af *inst/doc/tutorial.Rnw
e379798a8738fbd386b53c37c9a8d413 *inst/doc/tutorial.pdf
8860533aaab5520cf3529100f55f6187 *inst/external/severity.csv
8ca1b77e68c92959eb509d6bc331fb0d *inst/external/weather.csv
c5eef28f497e2b49dd17b248502759c2 *man/AMMI.Rd
f6b8bc1622fa8c1634ca16b9c5f010f4 *man/AMMI.contour.Rd
6b1b4f7a57428e386817a1fe2e80af13 *man/AMMI.Rd
ebe9f47adca4632dc636b734b8c880a3 *man/AMMI.contour.Rd
26b40210c762bf41ca5caf934a5a6612 *man/BIB.test.Rd
1134504b5a2f4c2619d3f7bc3a3dca8c *man/CIC.Rd
eaed94c9f44ffd5226bfa1b6aaecfb8c *man/Chz2006.Rd
Expand All @@ -137,17 +138,18 @@ e3eeed465d019b026a2097ff7a498fa8 *man/DAU.test.Rd
872c2db9c0da0e98657fbd1439c919b8 *man/Hco2006.Rd
d60a2bd9405a688667d4c0620fc58569 *man/LSD.test.Rd
81c57d5edf1d7e2aee447026aead30da *man/LxT.Rd
033432c8e7186ce52ddc69e4115163e7 *man/PBIB.test.Rd
c33e9ed84eabaad90c31fa4c4e5d2af7 *man/PBIB.test.Rd
ab9296959478e556bc8f16c88ca3498c *man/RioChillon.Rd
36cc5654c57818ec22e22a2a7d928ae2 *man/SNK.test.Rd
2085a7e0ae45af87124ea2516e8a42da *man/VanderWarden.Rd
507df85105caacc0a028ae358e2e6aa3 *man/agricolae-package.Rd
e4b498a1f2dd031776cb516f1535eca2 *man/agricolae-package.Rd
6f22fe8db8b205f9411f2144e048663e *man/audpc.Rd
c3be74203c7b29e57c89d6c7ff6e9310 *man/audps.Rd
c28a4d13e81936cba62481a1cf1bb052 *man/bar.err.Rd
8d8ee493075ae261ab28c2a67f230aa5 *man/bar.group.Rd
0fa231584f9418e8bacbde6380024cfb *man/carolina.Rd
2ba514a973d1917a4a11c6c2b14412da *man/clay.Rd
d9ba004a5d5c5d299eafcbf73b831ea7 *man/consensus.Rd
81a5fe435a89b2ab49ef0768bda56eb4 *man/consensus.Rd
3135fc3e0d8339e9ceebd55286a86f75 *man/corn.Rd
a0841c52f307715cd7205a5db647957b *man/correl.Rd
9d63b0e0feb0be85852ff5d8a7f3b13a *man/correlation.Rd
Expand All @@ -167,6 +169,7 @@ ee029eac4968297516233ee94dd4bada *man/design.dau.Rd
e9cb9128583b4ccbd9e837abc2272e09 *man/design.rcbd.Rd
5a0dc09f1419befc9f8dd83a058f7c07 *man/design.split.Rd
65aacd0acd2d7e730d90fdd2b0d44045 *man/design.strip.Rd
aacafde10b006c9e620f64098bdb9004 *man/design.youden.rd
2cea03b130dcc79ac02f7bd16507d65e *man/disease.Rd
102db3f9712b73e1d8db3b2ad272d09d *man/duncan.test.Rd
4c15d0566ce8a74aa4099dba4b4c6b6d *man/durbin.test.Rd
Expand All @@ -176,15 +179,15 @@ d110f25a7c11c055be0b2a08e7fc9e64 *man/genxenv.Rd
92dd56607e87e17b56995045f3607138 *man/graph.freq.Rd
fc95477bcd5c333af28a7faa183da01c *man/grass.Rd
f78032b7ef60b888495b7271674130a6 *man/greenhouse.Rd
cb7e95125c036d7fddac34744515d491 *man/grid3p.Rd
5c56a38337ee030658c6067fff61d0d3 *man/growth.Rd
4909ecbfc333d7c60055b25fef6df611 *man/haynes.Rd
be17faa0d1cb03a1afc14bac215cad32 *man/hcut.Rd
79e603db7f5b1fba84830c344a26b7f2 *man/hcut.Rd
419b8821f36672af21b529bb2f0bcb13 *man/heterosis.Rd
8d42122c6e61a4f7deb2e691e5fe85dd *man/hgroups.Rd
a6db0456a5141fc7d987dd1e451ac3ac *man/huasahuasi.Rd
96e33863b6646dcbdebf86714c075447 *man/index.bio.Rd
340b27a8c896a918d415ae4ff554aa97 *man/index.smith.Rd
31ae6a2855eea07ff489d81284ce28f1 *man/indexAMMI.Rd
4bd0435a023551319d00ca5267af3e0b *man/intervals.freq.Rd
d73552db731783ad655cf5862abbe796 *man/join.freq.Rd
0457a41c85ad47a640a705cb2e086435 *man/kendall.Rd
Expand All @@ -201,13 +204,13 @@ c9e24bc8c39bc7b9ddfc0300ad11f9db *man/natives.Rd
b172d8394908d54d6acadf6c114c3acd *man/nonadditivity.Rd
7bd986651564513b0c2911dfb4054ed7 *man/normal.freq.Rd
4332b59738e094a0136dd7e61db1af16 *man/ogive.freq.Rd
9f2fe47d25770b9fa6d603b9bf41c55a *man/order.group.Rd
df4733e61e2979b1642e5a8d38a725c6 *man/order.group.Rd
f453f0dfbbc1e140b5931abcc13c4f9f *man/order.stat.Rd
a20cc2ee6a10d07a551160e500e60163 *man/pamCIP.Rd
2fa51c63ea06feb12882badb0ae7cf70 *man/paracsho.Rd
93fd2b44325180cbd06c2872a0eb3f6b *man/path.analysis.Rd
ef7a4001bdcf95d23d04f665a2d19837 *man/plot.graph.freq.Rd
746c9164e86ca940aae394ccf36a5e7e *man/plotAMMI.Rd
d7e9cbb3b0b0ae4c1be7ab3004807e4e *man/plotAMMI.Rd
666a614d408be31639980a6006166325 *man/plots.Rd
50309c3d12fd5dff1ea549a218996f4a *man/plrv.Rd
c8c99926cf8dee7cca599e0aa4ff3d72 *man/polygon.freq.Rd
Expand Down Expand Up @@ -239,8 +242,7 @@ a972a88fecf2fc7d71dc3ed9866ad37b *man/tapply.stat.Rd
8d14822b77518ad4e1fd2eafd28534ab *man/waller.test.Rd
587c6d0f33a20c383fe2a551755cba43 *man/weatherSeverity.rd
60509e2db335f9901840d28514a19168 *man/wilt.Rd
90baa893e045dd26748c9f41c69b6fe5 *man/wxyz.Rd
010f8deecefba432ecc5a85132a947bf *man/yacon.Rd
d81007b91d101240ce51a854e8b30ed2 *man/zigzag.Rd
dbebdbd47aef6cf5b88e66e7121b371e *vignettes/lattice3X3.txt
45f7398d79ca4b03f8f3d57ff68a058f *vignettes/tutorial.Rnw
8ff96b7731ea7eb28060fd172e3257af *vignettes/tutorial.Rnw
5 changes: 5 additions & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,8 @@ exportPattern("^[[:alpha:]]+")
S3method(summary,graph.freq)
S3method(plot,graph.freq)
S3method(plot,AMMI)
import(klaR)
import(cluster)
import(MASS)
import(nlme)
import(spdep)
10 changes: 9 additions & 1 deletion NEWS
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
Changes in new version

Version agricolae 1-2.1 (August 25, 2014)
-------------------------------------------
1. Move packages from Suggests to Imports
2. AUDPS. The Area Under the Disease Progress Stairs.
3. AMMI stability value (ASV) and Yield stability index (YSI)
4. Design youden
5. Now the PBIB.test function uses missing values.

Version agricolae 1-2.0 (June 30, 2014)
-------------------------------------------
1. AMMI: aditional parameters PC=FALSE or TRUE, output principal components, check error equal cero.
Expand All @@ -18,7 +26,7 @@ when you have many treatments to use group=FALSE.
2. design.rcbd(..., continue=FALSE)
continue=TRUE or FALSE, continuous numbering of plot.
3. Median.test. New function for multiple comparisons of treatments with Median.
4. Now, AMMI function checks the m�nimum number of environments and genotypes.
4. Now, AMMI function checks the minimum number of environments and genotypes.
Now use console=TRUE or FALSE to output in screen. the graphs are produced by
the plot function.
5. plot.AMMI() or plot() functions generate plot of the AMMI with others principal components.
Expand Down
42 changes: 25 additions & 17 deletions R/PBIB.test.R
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
function (block, trt, replication, y, k, method=c("REML","ML","VC"),
test = c("lsd", "tukey"), alpha = 0.05, console=FALSE,group=TRUE)
{
#------------------
test <- match.arg(test)
if (test == "lsd")
snk = 3
Expand Down Expand Up @@ -47,20 +48,21 @@
}
# Use function lme #
if (method == "REML" | method == "ML") {
trt.adj <- as.factor(trt)

if (requireNamespace("nlme", quietly = TRUE)) {
trt.adj <- as.factor(trt)
if (method == "REML"){
modlmer <- lme(y ~ 0+trt.adj, random = ~1|replication/block.adj, method="REML")
model <- lme(y ~ trt.adj, random = ~1|replication/block.adj, method="REML")
modlmer <- nlme::lme(y ~ 0+trt.adj, random = ~1|replication/block.adj, method="REML",na.action=na.omit)
model <- nlme::lme(y ~ trt.adj, random = ~1|replication/block.adj, method="REML",na.action=na.omit)
}
if (method == "ML"){
modlmer <- lme(y ~ 0+trt.adj, random = ~1|replication/block.adj, method="ML")
model <- lme(y ~ trt.adj, random = ~1|replication/block.adj, method="ML")
modlmer <- nlme::lme(y ~ 0+trt.adj, random = ~1|replication/block.adj, method="ML",na.action=na.omit)
model <- nlme::lme(y ~ trt.adj, random = ~1|replication/block.adj, method="ML",na.action=na.omit)
}
Afm<-anova(model)
VarRand<-matrix(rep(0,3),nrow=3)
VarRand[c(1,3),1]<- as.numeric(VarCorr(model)[4:5,1])
VarRand[2,1]<-as.numeric(VarCorr(model)[2,1])
VarRand[c(1,3),1]<- as.numeric(nlme::VarCorr(model)[4:5,1])
VarRand[2,1]<-as.numeric(nlme::VarCorr(model)[2,1])
CMerror<-as.numeric(VarRand[3,1])
VarRand<-data.frame(VarRand)
names(VarRand)<-"Variance"
Expand All @@ -71,11 +73,21 @@
ANOVA[1,3]<- ANOVA[2,3]*ANOVA[1,4]
ANOVA[,2]<-ANOVA[,1]*ANOVA[,3]
ANOVA[2,4:5]<-NA
}

tauIntra<-nlme::fixef(modlmer)
vartau <- vcov(modlmer)
DIA<-as.matrix(vartau)
dvar<-sqrt(diag(DIA))
}
else {
return("Please install nlme package for lme and VarCorr functions")
}
}
#
b <- s * r
glt <- ntr - 1
if (method == "VC") {
if (requireNamespace("MASS", quietly = TRUE)) {
SCt<- anova(model)[2, 2]
Ee <- deviance(model)/glerror
Eb <- anova(model)[3, 3]
Expand Down Expand Up @@ -115,19 +127,15 @@
phi <- r * (Eb - Ee)/((r - 1) * Ee)
lambda <- 1/(r * k * (1/phi + 1) - k)
W <- t(N) %*% N - k * Ib - g * kronecker((Jr - Ir), Js)
inversa <- ginv(Ib - lambda * W)
inversa <- MASS::ginv(Ib - lambda * W)
tauIntra <- t(X) %*% y/r - lambda * N %*% inversa %*% c0
vartau <- (Ee/r) * (Iv + lambda * N %*% inversa %*% t(N))
dvar <- sqrt(diag(vartau))
}

# use function lmer #
if (method == "REML" | method == "ML") {
tauIntra<-fixef(modlmer)
vartau <- vcov(modlmer)
DIA<-as.matrix(vartau)
dvar<-sqrt(diag(DIA))
}
else {
return("Please install MASS package for ginv function")
}
}
# -------------------
ntr0<-ncol(vartau)
if(ntr0<ntr) {
Expand Down
26 changes: 26 additions & 0 deletions R/audps.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
`audps` <-
function(evaluation, dates, type = "absolute") {
if(!(is.matrix(evaluation) | is.data.frame(evaluation))){
evaluation<-rbind(evaluation)
}
n<-length(dates)
k<-ncol(evaluation)
if (n!=k) {
cat("Error:\nThe number of dates of evaluation \nmust agree with the number of evaluations\n")
return()
}
d1<-(dates[2]-dates[1])/2
d2<-(dates[n]-dates[n-1])/2
d<-d1+d2+dates[n]-dates[1]
audps<-0
for (i in 1:(n-1)) {
audps<- audps + evaluation[,i]*(dates[i+1]-dates[i])
}
audps<- audps + evaluation[,n]*(dates[n]-dates[n-1])
if (type =="relative" ) audps <-audps/(d*100)
if (type =="absolute" | type =="relative" ) {
return(audps)
}
else cat("Error: type is 'absolute' or 'relative'\n\n")
}

9 changes: 8 additions & 1 deletion R/consensus.R
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,14 @@ function(data,distance=c("binary","euclidean","maximum","manhattan","canberra",
t0<-Sys.time()
distance <- match.arg(distance)
method <- match.arg(method)
if(distance=="gower") distancia<-daisy(data,metric=distance)
if(distance=="gower") {
if (requireNamespace("cluster", quietly = TRUE)) {
distancia<-cluster::daisy(data,metric=distance)
}
else{
return("Please install cluster package for calculate gower distance")
}
}
else distancia<-dist(data,method=distance)
nc<-ncol(data)
nr<-nrow(data)
Expand Down
45 changes: 45 additions & 0 deletions R/design.youden.r
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
`design.youden` <-
function (trt,r,serie=2,seed=0,kinds="Super-Duper",first=TRUE)
{
number<-10
if(serie>0) number<-10^serie
t <- length(trt) # number of treatment
if (seed == 0) {
genera<-runif(1)
seed <-.Random.seed[3]
}
set.seed(seed,kinds)
parameters<-list(design="youden",trt=trt,r=r,serie=serie,seed=seed,kinds=kinds)
a <- matrix(1,nrow=t,ncol=r)
# Generate matrix random
for (j in 1:r){
i<-c(j:t)
if(j>1) i<-c(i,1:(j-1))
a[,j]<-i
}
m<-sample(1:t,t)
M<-m[a]
a<-trt[M]
dim(a)<-c(t,r)
# Randomize row and column
m<-sample(1:r,r)
a[,m]-> a
m<-c(1,sample(2:t,t-1))
a<-a[m,]
if (!first) {
m<-order(a[1,])
a<-a[,m]
}
a<-t(a)
trat<-as.vector(a)
columna <- rep(gl(r, 1), t)
fila <- gl(t, r)
fila <- as.character(fila)
fila <- as.numeric(fila)
plots <- fila*number+(1:r)
book <- data.frame(plots, row = as.factor(fila), col = as.factor(columna),
trat = as.factor(trat))
names(book)[4] <- c(paste(deparse(substitute(trt))))
outdesign<-list(parameters=parameters,book=book)
return(outdesign)
}
Loading

0 comments on commit f3972bc

Please sign in to comment.