Description Usage Arguments Value See Also Examples
These functions create data lists with a single variable (variable
) or several variables with identical dimensions of replication (variableGroup
).
1 2 | variable(x, dimids, name, check = TRUE)
variableGroup(x, dimids)
|
x |
For |
dimids |
Character vector of identifiers for the dimensions of replication of the variable(s). |
name |
Character string giving the name of the variable |
check |
|
A data.list
object.
Designed to be used in variable arithmetic (see Ops.data.list
).
To create more complex data lists see: data.list
; as.data.list
; dlcast
; read.multitable
1 2 3 4 5 6 7 8 9 10 11 12 13 | ##
variable(runif(5), "a dimension", "a variable")
## stringing variables together using the + operator
variable(matrix(runif(15), 5, 3), c("n","m"), "A") +
variable(letters[1:3], "m", "B") +
variable(runif(5), "n", "C") +
variable(array(runif(15*4), c(3,5,4)), c("m","n","p"), "D") +
variableGroup(data.frame(a = runif(5), b = runif(5)), "n") +
variableGroup(list(
c = matrix(runif(20), 4, 5),
d = matrix(runif(20), 4, 5)
), c("p","n"))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.