mxAlgebraFromString: Create MxAlgebra object from a string

Description Usage Arguments See Also Examples

View source: R/MxAlgebra.R

Description

Create MxAlgebra object from a string

Usage

1

Arguments

algString

the character string to convert into an R expression

name

An optional character string indicating the name of the object.

dimnames

list. The dimnames attribute for the algebra: a list of length 2 giving the row and column names respectively. An empty list is treated as NULL, and a list of length one as row names. The list can be named, and the list names will be used as names for the dimensions.

...

Not used. Forces any remaining arguments to be specified by name.

See Also

mxAlgebra

Examples

1
2
3
4
5
6
7
A <- mxMatrix(values = runif(25), nrow = 5, ncol = 5, name = 'A')
B <- mxMatrix(values = runif(25), nrow = 5, ncol = 5, name = 'B')
model <- mxModel(A, B, name = 'model',
  mxAlgebraFromString("A * (B + A)", name = 'test'))
model <- mxRun(model)
model[['test']]$result
A$values * (B$values + A$values)

OpenMx documentation built on Nov. 17, 2017, 6:50 a.m.