Hi,
I am really enjoying the package, and I would like to congratulate all authors on their work. This package has many ideas I had a few years ago; however, with several improvements and covering several experimental designs.
My suggestion here is minimal but can contribute to the output of some functions you have there. I think you should be more explicitly when reporting replication in your output, e.g., function latin_square()
has the following output:
R> latin_data <- data.frame(list(ROW = paste("Period", 1:5, sep = ""),
+ COLUMN = paste("Cow", 1:5, sep = ""),
+ TREATMENT = paste("Diet", 1:5, sep = "")))
R> latinSq2 <- latin_square(t = NULL,
+ reps = 2,
+ plotNumber = 101,
+ planter = "cartesian",
+ seed = 1981,
+ data = latin_data)
R> print(latinSq2)
$squares
$squares[[1]]
Cow1 Cow2 Cow3 Cow4 Cow5
Period1 "Diet4" "Diet3" "Diet2" "Diet1" "Diet5"
Period2 "Diet1" "Diet2" "Diet4" "Diet5" "Diet3"
Period3 "Diet3" "Diet5" "Diet1" "Diet2" "Diet4"
Period4 "Diet2" "Diet4" "Diet5" "Diet3" "Diet1"
Period5 "Diet5" "Diet1" "Diet3" "Diet4" "Diet2"
$squares[[2]]
Cow1 Cow2 Cow3 Cow4 Cow5
Period1 "Diet2" "Diet4" "Diet5" "Diet3" "Diet1"
Period2 "Diet1" "Diet2" "Diet3" "Diet4" "Diet5"
Period3 "Diet3" "Diet5" "Diet1" "Diet2" "Diet4"
Period4 "Diet4" "Diet1" "Diet2" "Diet5" "Diet3"
Period5 "Diet5" "Diet3" "Diet4" "Diet1" "Diet2"
$plotSquares
$plotSquares[[1]]
[,1] [,2] [,3] [,4] [,5]
[1,] 101 102 103 104 105
[2,] 106 107 108 109 110
[3,] 111 112 113 114 115
[4,] 116 117 118 119 120
[5,] 121 122 123 124 125
$plotSquares[[2]]
[,1] [,2] [,3] [,4] [,5]
[1,] 201 202 203 204 205
[2,] 206 207 208 209 210
[3,] 211 212 213 214 215
[4,] 216 217 218 219 220
[5,] 221 222 223 224 225
...
In this case, replication output has been reported as list numbers. I think should be useful for end-users to see these numbers actually representing replication numbers. Thus, I did a modification in your function latin_square()
including this information in the output, where the results now is reported as:
$squares$rep1
Cow1 Cow2 Cow3 Cow4 Cow5
Period1 "Diet4" "Diet3" "Diet2" "Diet1" "Diet5"
Period2 "Diet1" "Diet2" "Diet4" "Diet5" "Diet3"
Period3 "Diet3" "Diet5" "Diet1" "Diet2" "Diet4"
Period4 "Diet2" "Diet4" "Diet5" "Diet3" "Diet1"
Period5 "Diet5" "Diet1" "Diet3" "Diet4" "Diet2"
$squares$rep2
Cow1 Cow2 Cow3 Cow4 Cow5
Period1 "Diet2" "Diet4" "Diet5" "Diet3" "Diet1"
Period2 "Diet1" "Diet2" "Diet3" "Diet4" "Diet5"
Period3 "Diet3" "Diet5" "Diet1" "Diet2" "Diet4"
Period4 "Diet4" "Diet1" "Diet2" "Diet5" "Diet3"
Period5 "Diet5" "Diet3" "Diet4" "Diet1" "Diet2"
$plotSquares
$plotSquares$rep1
[,1] [,2] [,3] [,4] [,5]
[1,] 101 102 103 104 105
[2,] 106 107 108 109 110
[3,] 111 112 113 114 115
[4,] 116 117 118 119 120
[5,] 121 122 123 124 125
$plotSquares$rep2
[,1] [,2] [,3] [,4] [,5]
[1,] 201 202 203 204 205
[2,] 206 207 208 209 210
[3,] 211 212 213 214 215
[4,] 216 217 218 219 220
[5,] 221 222 223 224 225
...
What do you think about including this modification in other functions you have?
Here is the raw code I've included:
latin_square <- function(t = NULL, reps = 1, plotNumber = 101, planter = "serpentine",
seed = NULL, locationNames = NULL, data = NULL) {
...
# line 106----------------------------------------------------------
plotSquares <- setNames(vector(mode = "list", length = reps),
paste0("rep", seq(1:reps))) # set names
#line 152-----------------------------------------------------------
...
#---------------------------------------------------------------------
lsd.reps <- setNames(lsd.reps, paste0("rep", seq(1:reps))) # set names
#---------------------------------------------------------------------
...
return(list(squares = lsd.reps, plotSquares = plotSquares,
fieldBook = latin_design))
}