DidierMurilloF / FielDHub

FielDHub is an R Shiny design of experiments (DOE) app that aids in the creation of traditional, unreplicated, augmented and partially replicated (p-rep) designs applied to agriculture, plant breeding, forestry, animal and biological sciences.
https://didiermurillof.github.io/FielDHub/
Other
39 stars 20 forks source link

Error for `alpha_lattice(t = 1:8, k = 2, r = 2)` #20

Closed SchmidtPaul closed 1 year ago

SchmidtPaul commented 1 year ago

Hi, I just tried to run the following code and received this error:

r <- 2
k <- 2
trt <- 1:8

length(trt) / k # = s
#> [1] 4

FielDHub::alpha_lattice(t = trt,
                        k = k,
                        r = r)
#> Error in if (numbers::isPrime(t)) shiny::validate("Combinations for this amount of treatments do not exist."): Bedingung hat Länge > 1

Created on 2023-01-31 with reprex v2.0.2

Maybe I am missing something, but is r = 2 and k = 2 not a valid option here? Note that agricolae::design.alpha() also throws an error - see myaseen208/agricolae#5

SchmidtPaul commented 1 year ago

My bad, trt should simply be the number of treatments (and not the levels) to make it work.