knitr::opts_chunk$set(echo = TRUE)
install.packages("devtools") devtools::install_github("mkearney/lavplot") library(lavplot)
library(lavplot)
## plot nodes with grid background par(bg = "#f5f5f5") plot_nodes(c(-.75, 0, .75), c(-.5, .5, -.5), panel.first = grid(8)) ## draw arrows draw.arrow(-.75, -.50, .00, .50) draw.arrow( .00, .50, .75, -.50) draw.arrow(-.75, -.50, .75, -.50) ## add coefficients text(-.45, .00, ".25") text( .45, .00, ".33") text( .00, -.55, "-.15") ## add var names text(-.75, -.50, "X") text( .00, .50, "W") text( .75, -.50, "Y")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.