1 | mat2list(m, grp.dat)
|
m |
|
grp.dat |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 | ##---- Should be DIRECTLY executable !! ----
##-- ==> Define data, use random,
##-- or do help(data=index) for the standard data sets.
## The function is currently defined as
function (m, grp.dat)
{
if (!is.null(dim(m)))
m = as.matrix(m)
if (!is.matrix(m))
stop("Data must be stored in a matrix or data frame")
p = ncol(m)
p1 = p + 1
M = cbind(m, grp.dat)
print(dim(M))
x <- mat2grp(M[, 1:p1], p1)
for (i in 1:length(x)) x[[i]] = x[[i]][, 1:p]
x
}
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.