View source: R/helpers_sparta.R
sparta_struct | R Documentation |
Helper function to construct a sparta object with given values and dim names
sparta_struct(x, vals, dim_names)
x |
matrix where columns represents cells in an array-like object |
vals |
vector of values corresponding to x |
dim_names |
a named list |
A sparta object
x <- array( c(1,0,0,2,3,4,0,0), dim = c(2,2,2), dimnames = list( a = c("a1", "a2"), b = c("b1", "b2"), c = c("c1", "c2") ) ) sx <- as_sparta(x) sparta_struct(unclass(sx), vals(sx), dim_names(sx))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.