plot_nodes: plot_nodes

Description Usage Arguments Value Examples

Description

plot_nodes

Usage

1
plot_nodes(x, y, cex = 0.2, h = 1, w = 1, ...)

Arguments

x

Vector of x coords with recommended min/max of -.75 to .75.

y

Vector of y coords with recommended min/max of -.75 to .75.

cex

Size of nodes defaults to .2

h

height of plot defaults to 1.

w

width of plot defaults to 1.

...

Other args passed on to symbols().

Value

Node diagram

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
cex <- .25
plot_nodes(c(-.75, -.75, -.75, 0,  .75, .75),
           c(-.75,    0,  .75, 0, -.5,  .5),
           cex = cex)
draw.arrow(-.75, -.75, 0, 0, cex)
draw.arrow(-.75, 0, 0, 0, cex)
draw.arrow(-.75, .75, 0, 0, cex)
draw.arrow(   0, 0, .75, .5, cex)
draw.arrow(   0, 0, .75, -.5, cex)
text(-.75, .75, "Education")
text(-.75, 0, "Age")
text(-.75, -.75, "Race")
text(0, 0, "Political\nEngagement")
text(.75, .5, "Political\nParticipation")
text(.75, -.5, "Civic\nEngagement")

## mediation model
cex <- .35
plot_nodes(c(-1.5, 0, 1.5), c(-.5, .5, -.5),
           w = 1.5, h = 1, cex)
draw.arrow(-1.5, -.5, 1.5, -.5, cex)
draw.arrow(-1.5, -.5,  .0 ,  .5, cex)
draw.arrow( 0, .5,   1.5,  -.5, cex)
text(-1.5, -.5, "x")
text(0, .5, "w")
text(1.5, -.5, "y")

mkearney/lavplot documentation built on May 23, 2019, 1:06 a.m.