Learn R Programming

pathdiagram (version 0.1.9.1)

arrow: Plot arrow between variables

Description

Use this function to draw connecting arrows between manifest and latent variables.

Usage

arrow(from, to, start = "east", end = "west",
    length = 0.1, angle = 10, code = 2, col = "#d2def1",
    lwd = 3, ...)

Arguments

from

An object of either class "manifest" or "latent". This object is the origin of the arrow.

to

An object of either class "manifest" or "latent". This object is the destination of the arrow.

start

Character string to specify the starting direction of the arrow. Options are "north", "south", "east", "west".

end

Character string to specify the ending direction of the arrow. Options are "north", "south", "east", "west".

length

length of the edges of the arrow head (in inches).

angle

angle from the shaft of the arrow to the edge of the arrow head.

code

integer code, determining kind of arrows to be drawn.

col

color of the arrow.

lwd

width of the arrow.

...

other arguments passed on to arrows.

See Also

manifest, latent, draw

Examples

Run this code
# NOT RUN {
 # latent variables
 attack = latent("ATTACK", x=0.35, y=0.7, rx=0.08, ry=0.06)
 defense = latent("DEFENSE", x=0.35, y=0.3, rx=0.08, ry=0.06)
 success = latent("SUCCESS", x=0.65, y=0.5, rx=0.08, ry=0.06)

 # open wall
 wall()
 # draw latent variables
 draw(attack)
 draw(defense)
 draw(success)
 # add arrows
 arrow(from=attack, to=success, start="east", end="west")
 arrow(from=defense, to=success, start="east", end="west")
 
# }

Run the code above in your browser using DataLab