Last chance! 50% off unlimited learning
Sale ends in
It converts a character matrix with starting values to a character matrix without the starting values.
as.symMatrix(x)
A character or numeric matrix or a list of character or numeric matrices.
A character matrix.
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.
# NOT RUN {
## 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"
# }
Run the code above in your browser using DataLab