Use a named vector or named arguments to create a matrix of the directions of indicators of factors.
Arguments
- factor_layout
Argument description.
- ...
Additional arguments. If the first argument is not named, then it should be a named vector of directions, names being the names of the factors, and directions can be one of these values:
"up"
,"down"
,"left"
,"right"
. Other arguments are ignored. If the arguments are named, then the names of the arguments are the names of the factors, and the argument values are the direction for the factors.
Value
A character matrix of the same
dimension as factor_layout
. The
cells of factor names are replaced
by the directions to place their
indicators.
Details
A helper function to make
it easier to create the matrix
used by set_sem_layout()
to
indicate where the indicators of
each factor should be positioned.
It works in two modes. If the
first argument is a named vector,
such as c(f1 = "up", f2 = "down")
,
then this vector will be used to
create the direction matrix.
If the arguments are named, such as
auto_factor_point_to(factor_layout, f1 = "up", f2 = "down"
,
then the names are treated as the
factor names, and the values of
the arguments are treated as the
directions.
The matrix created can then be used
for the argument factor_point_to
in set_sem_layout()
.