node: Create a node position list

View source: R/diyPaths.R

nodeR Documentation

Create a node position list

Description

Helper function that creates a list of arguments which specify a given node's position and its label in the diagram, designed for use within the node_positions argument of diyPaths().

Usage

node(name, x = 0, y = 0, label = NULL)

Arguments

name

The name of the variable within the lavaan model.

x

Numeric value for the x-coordinate of the node's centre. Default is 0.

y

Numeric value for the y-coordinate of the node's centre. Default is 0.

label

Custom label to display instead of lavaan variable name. Defaults to the lavaan variable name.

Value

A list containing arguments that specify a node's position and label, for use within the node_positions argument of diyPaths().

See Also

path() to specify the paths between nodes; diyPaths() to render the diagram; template() to generate a starting node_positions list.

Examples


#a list that specifies a node positioned on x = 1, y = 2,
#and relabelled from its `lavaan` model name.

node(name = "bpm", x = 1, y = 2,  label = "Beats per Minute")


diy.sem.plot documentation built on Nov. 11, 2026, 1:11 a.m.