View source: R/layout_matrix.R
layout_matrix | R Documentation |
Create the layout matrix from a list of coordinates for semPaths.
layout_matrix(...)
... |
Each node in the matrix is specified by this form: |
The layout argument in semPlot::semPaths()
accepts a
matrix with node labels as the elements, and NA
for empty cells.
This function allows user to create the matrix using a list of
coordinates for the node labels.
A layout matrix for the layout argument of
semPlot::semPaths()
.
# Suppose this is the layout to be created:
m0 <- matrix(c("x1", NA, NA, NA,
"x2", "x3", NA, NA,
NA, "x4", NA, "x5"), byrow = TRUE, 3, 4)
# This call will create the same matrix.
m1 <- layout_matrix(x1 = c(1, 1),
x2 = c(2, 1),
x3 = c(2, 2),
x4 = c(3, 2),
x5 = c(3, 4))
#The two matrices should be identical.
m0 == m1
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.