as.symMatrix: Convert a Character Matrix with Starting Values to a...

View source: R/as.mxMatrix.R

as.symMatrixR Documentation

Convert a Character Matrix with Starting Values to a Character Matrix without Starting Values

Description

It converts a character matrix with starting values to a character matrix without the starting values.

Usage

as.symMatrix(x)

Arguments

x

A character or numeric matrix or a list of character or numeric matrices.

Details

If there are non-numeric values in x, they are treated as the labels of the free parameters. If a "*" is present, the numeric value on the left-hand side will be treated as the starting value for a free parameter or a fixed value for a fixed parameter. If it is a matrix of numeric values, there are no free parameters in the output matrix. This function removes the starting values and "*" in the matrices.

Value

A character matrix.

Author(s)

Mike W.-L. Cheung <mikewlcheung@nus.edu.sg>

See Also

as.mxMatrix

Examples

## a and b are free parameters with starting values and labels
(a1 <- matrix(c(1:4, "5*a", 6, "7*b", 8, 9), ncol=3, nrow=3))
#      [,1] [,2]  [,3] 
# [1,] "1"  "4"   "7*b"
# [2,] "2"  "5*a" "8"  
# [3,] "3"  "6"   "9"  

(as.symMatrix(a1))
#      [,1] [,2] [,3]
# [1,] "1"  "4"  "b" 
# [2,] "2"  "a"  "8" 
# [3,] "3"  "6"  "9"

metaSEM documentation built on Aug. 10, 2023, 1:09 a.m.