-
Notifications
You must be signed in to change notification settings - Fork 8
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
Error for design.alpha(trt = 1:8, k = 2, r = 2)
#5
Comments
Furthermore, it does work in {FielDHub}: r <- 2
k <- 2
trt <- 1:8
length(trt) / k # = s
#> [1] 4
out <- FielDHub::alpha_lattice(t = length(trt),
k = k,
r = r)
out
#> Alpha Lattice Design
#>
#> Information on the design parameters:
#> List of 7
#> $ Reps : num 2
#> $ iBlocks : num 4
#> $ NumberTreatments: int 8
#> $ NumberLocations : num 1
#> $ Locations : int 1
#> $ seed : num 5397
#> $ lambda : num 0.286
#>
#> 10 First observations of the data frame with the alpha_lattice field book:
#> ID LOCATION PLOT REP IBLOCK UNIT ENTRY TREATMENT
#> 1 1 1 101 1 1 1 1 G-1
#> 2 2 1 102 1 1 2 3 G-3
#> 3 3 1 103 1 2 1 2 G-2
#> 4 4 1 104 1 2 2 6 G-6
#> 5 5 1 105 1 3 1 8 G-8
#> 6 6 1 106 1 3 2 5 G-5
#> 7 7 1 107 1 4 1 7 G-7
#> 8 8 1 108 1 4 2 4 G-4
#> 9 9 1 201 2 1 1 4 G-4
#> 10 10 1 202 2 1 2 2 G-2 Created on 2023-01-31 with reprex v2.0.2 |
Yes, it works only for k>=3 when r=2. if (r == 2 & k<=s ) { |
Thanks for the reply @Sherry520 |
Hi, I just tried to run the following code and received this error:
Created on 2023-01-31 with reprex v2.0.2
According to the details of the function's documentation we should have case I.
Hence,
r = 2
✔️ and sinces = length(trt)/k = 4
, we also havek <= s
✔️As a consequence, we end up in the respective if statement
if (r == 2 & k<=s )
(click for permalink to code on github):However, the for statement has a
3:k
in it, which - I guess - only works fork >= 3
?So I am not sure - is this intended because
r=2
&k=2
is too small? Or what am I missing?The text was updated successfully, but these errors were encountered: