set_mvms | R Documentation |
Creates list data structure from mvms specification
set_mvms(x)
x |
a multivariate multistate (mvms) specification as described above |
Accepts a mvms specification which is a list with named character vectors and optionally a vector named exclude. The length of the list (except for exclude) is the multivariate dimension. The name of each dimension is the list element name. Each character vector specifies the one character labels for the states of that dimension and optionally a reserved character "u" to specify that there is state uncertainty for that dimension. The name vector exclude can be used to remove variable combinations that cannot occur in the data.
The code tests to make sure that the input mvms specification is of the correct structure and it stops with an error message if not. The code returns a list structure with a number of elements described under return value below.
a list with the following elements: 1) mvms - the input specification, 2) nd - the number of dimensions, 3) df - the dataframe containing all combinations of observations across dimensions including uncertain states, 4) df.states - the dataframe with all combinations of states across dimensions, 5) uncertain - boolean vector with nd elements indicating whether there is uncertainy in states for each dimension.
Jeff Laake
set_mvms(list(location=c("A","B","C"),repro_status=c("N","P","u"),exclude=c("CP")))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.