| path | R Documentation |
Helper function that creates a list of arguments which specify a given path's position and fine-tuning adjustments,
designed for use within the path_positions argument of diyPaths().
path(
from,
to,
side_from = "right",
side_to = "left",
cov_curve = NULL,
nudge_text_x = 0,
nudge_text_y = 0,
variance_position = "top"
)
from |
The source variable name within the |
to |
The target variable name within the |
side_from |
Side of source node where path starts ("top", "bottom", "left", "right"). Default is "right". |
side_to |
Side of target node where path ends ("top", "bottom", "left", "right"). Default is "left". |
cov_curve |
Numeric value for curvature of covariance/correlation paths. Default is NULL. |
nudge_text_x |
Numeric fine tuning adjustment for path estimate text along the x-axis. Default is |
nudge_text_y |
Numeric fine tuning adjustment for path estimate text along the y-axis. Default is |
variance_position |
Placement of variance/residual paths ("top", "bottom", "left", or "right"). Default is "top". |
from/to in path() must exactly match the variable name used in the lavaan model syntax.
Furthermore, the order must also be correct for regression or loading paths. A misspelled or mismatched
path() entry will not raise an error, instead, it will use default attachment points and values, not applying
specific customisations. This can be completely avoided using template().
cov_curve controls the curvature of covariance/correlation paths: its size sets how strongly the
path bends, and its sign sets which way. If a path bends the wrong way, flip the sign. Best results
typically range from -1 to 1.
A list containing arguments that specify a path's position and fine-tuning adjustments, for use within the path_positions argument of diyPaths().
node() to specify node positions;
diyPaths() to render the diagram; template() to generate a starting path_positions list.
#a list that specifies a regression path of node "anxiety" predicting node "depression".
path(from = "anx", to = "dep", side_from = "right", side_to = "left")
#a list that specifies a covariance/correlation path of node "anxiety" and node "depression".
#Order of "from" and "to" does not matter for covariance/correlation.
path(from = "dep", to = "anx", side_from = "left", side_to = "left", cov_curve = -0.6)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.