plot.psem uses DiagrammeR to generate path diagrams of `piecewiseSEM`` fits within R.

# S3 method for psem
plot(mod, return = FALSE, node_attrs = data.frame(shape
  = "rectangle", color = "black", fillcolor = "white"),
  edge_attrs = data.frame(style = "solid", color = "black"),
  ns_dashed = T, alpha = 0.05, show = "std", digits = 3,
  add_edge_label_spaces = TRUE, ...)

Arguments

mod

a psem() object

return

whether to return the output from DiagrammeR::create_graph() for modification and later plotting

node_attrs

List of node attributes to overide defaults of rectangular nodes with black outline and white fill. See here and here for a more complete rundown of options.

edge_attrs

List of edge attributes to overide defaults of solid black arrows. See here and here for a more complete rundown of options.

ns_dashed

If TRUE, paths that are not different from 0 will be dashed rather than solid, unless the wholse is overridden in edge_attrs

alpha

The alpha level for assessing whether a path is different from 0

show

What types of path coefficients are shown? Default "std" is standardized coefficients. For undstandardized, use "unstd"

digits

How many significant digits should be shown?

add_edge_label_spaces

Should spaces by added on either side of edge labels? Default is TRUE as otherwise paths too often overlap edges.

...

Other arguments to DiagrammeR::render_graph()

Value

Returns an object of class DiagrammeR::dgr_graph

Examples

data(keeley) mod <- psem( lm(rich ~ cover, data=keeley), lm(cover ~ firesev, data=keeley), lm(firesev ~ age, data=keeley), data = keeley ) plot(mod) ### More customized plot keeley_graph <- plot.psem(mod, return=TRUE)
#> Error in plot.psem(mod, return = TRUE): could not find function "plot.psem"
plot(mod, node_attrs = list( shape = "rectangle", color = "black", fillcolor = "orange", x = 3, y=1:4))