Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The agricolae::design.graeco() function keeps returning NA values. #1

Open
despresj opened this issue Mar 12, 2021 · 1 comment
Open

Comments

@despresj
Copy link

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"

@BB1464
Copy link

BB1464 commented Feb 18, 2022

Alternatively you can try this

library(agricolae)

my attempt

t1 <- c("A", "B", "C", "D", "E")
t2 <- c("z", "y", "x", "w", "v")

plan <- design.graeco(trt1 = t1,trt2 = t2,seed = 100,randomization = TRUE)

plan$book

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants