latinRand | R Documentation |
Randomly draws an assignment vector or matrix according to the isomorphic Latin square design, for a specified number of permutations.
latinRand(w, nrand, row, col)
w |
a vector or matrix of assignments. |
nrand |
a number specifying the desired number of random assignments. |
row |
a vector of row designations. |
col |
a vector of column designations. |
Assignments are randomly permuted along rows and columns such that the Latin square design is preserved.
If w
is a matrix, the permutations occur by row.
A list of random isomorphic assignment vectors or matrices.
Joseph J. Lee and Tirthankar Dasgupta
completeRand
, blockRand
w <- c( "C", "D", "B", "A", "A", "B", "D", "C", "D", "C", "A", "B", "B", "A", "C", "D" ) row <- rep(1:4, 4) col <- c(rep(1, 4), rep(2, 4), rep(3, 4), rep(4, 4)) latinRand(w, nrand = 5, row, col)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.