variable: Create simple data lists

Description Usage Arguments Value See Also Examples

View source: R/variablearithmetic.R

Description

These functions create data lists with a single variable (variable) or several variables with identical dimensions of replication (variableGroup).

Usage

1
2

Arguments

x

For variable, the variable (vector, matrix, or array); for variableGroup, a data.frame or list with the variables in the group.

dimids

Character vector of identifiers for the dimensions of replication of the variable(s).

name

Character string giving the name of the variable

check

as.data.list

Value

A data.list object.

See Also

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

Examples

 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"))

stevencarlislewalker/multitable documentation built on May 26, 2017, 7:59 p.m.