design.mat <- function(saminfo) {
tmp <- which(colnames(saminfo) == "Batch")
tmp1 <- as.factor(saminfo[, tmp])
cat("Found", nlevels(tmp1), "batches\n")
design <- build.design(tmp1, start = 1)
ncov <- ncol(as.matrix(saminfo[, -c(1:2, tmp)]))
cat("Found", ncov, "covariate(s)\n")
if (ncov > 0) {
for (j in 1:ncov) {
tmp1 <- as.factor(as.matrix(saminfo[,
-c(1:2, tmp)])[, j])
design <- build.design(tmp1, des = design)
}
}
design
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.