Description Usage Arguments Value Author(s) See Also Examples
View source: R/makeBlkDesMat.R
Construct a binary matrix representing the block design. The rows are corresponding to the observations and the columns are corresponding to the blocks.
1 | makeBlkDesMat(design.df, blkTerm)
|
design.df |
a data frame containing the experimental design. Requires
every column be a |
blkTerm |
a vector of character containing the labels of the block
terms in the model generated by the |
A list of the binary matrices.
Kevin Chang
1 2 3 4 5 6 7 8 9 10 11 12 13 14 | design1 <- local({
Ani = as.factor(LETTERS[c(1,2,3,4,
5,6,7,8)])
Trt = as.factor(letters[c(1,1,1,1,
2,2,2,2)])
data.frame(Ani, Trt, stringsAsFactors = TRUE )
})
blk.str = "Ani*Trt"
rT = terms(as.formula(paste("~", blk.str, sep = "")), keep.order = TRUE)
blkTerm = attr(rT,"term.labels")
Z = makeBlkDesMat(design1, blkTerm)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.