-
Notifications
You must be signed in to change notification settings - Fork 11
Description
The agricolae::design.graeco() function keeps returning NA values.
So far, I have tried, downloading the development version of the package with r remotes::install_github("myaseen208/agricolae”), running the source code and debugging it, and experimenting with different combinations of the arguments. All of this produces the same NA’s in the columns. I think there may be something wrong with the package or I am completely misusing it. If I am unable to get the package working may I create it manually?
Does not work
library(agricolae)
# my attempt
t1 <- c("A", "B", "C", "D", "E")
t2 <- c("z", "y", "x", "w", "v")
design.graeco(trt1 = t1, trt2 = t2)
# Return coluns with NA in the treatment 2 position
[,1] [,2] [,3] [,4] [,5]
[1,] "A NA" "E NA" "C NA" "B NA" "D NA"
[2,] "E NA" "C NA" "B NA" "D NA" "A NA"
[3,] "C NA" "B NA" "D NA" "A NA" "E NA"
[4,] "B NA" "D NA" "A NA" "E NA" "C NA"
[5,] "D NA" "A NA" "E NA" "C NA" "B NA"
# examples found in
# ?design.graeco
T1<-c("a","b","c","d")
T2<-c("v","w","x","y")
outdesign <- design.graeco(T1,T2,serie=1)
graeco<-outdesign$book
plots <-as.numeric(graeco[,1])
print(outdesign$sketch)
[,1] [,2] [,3] [,4]
[1,] "NA NA" "NA NA" "NA NA" "NA NA"
[2,] "NA NA" "NA NA" "NA NA" "NA NA"
[3,] "NA NA" "NA NA" "NA NA" "NA NA"
[4,] "NA NA" "NA NA" "NA NA" "NA NA"
# 10 x 10
T1 <- letters[1:10]
T2 <- 1:10
outdesign <- design.graeco(T1,T2,serie=2)
print(outdesign$sketch)
This Does work
t1 <- c("A", "B", "C", "D", "E")
t2 <- 1:5
graeco <- agricolae::design.graeco(trt1 = t1, trt2 = t2)$sketch
graeco
[,1] [,2] [,3] [,4] [,5]
[1,] "C 1" "B 4" "E 2" "A 3" "D 5"
[2,] "B 2" "E 3" "A 5" "D 1" "C 4"
[3,] "E 5" "A 1" "D 4" "C 2" "B 3"
[4,] "A 4" "D 2" "C 3" "B 5" "E 1"
[5,] "D 3" "C 5" "B 1" "E 4" "A 2"