Learn R Programming

networktools (version 1.1.0)

plot.edge.impact: Plot "edge.impact" objects

Description

Convenience function for generating edge impact plots

Usage

# S3 method for edge.impact
plot(x, nodes = c("first", "all"),
  type.edgeplot = c("contrast", "single"), title = NULL, maximum = "auto",
  ...)

Arguments

x

an output object from an impact function (edge.impact)

nodes

specifies which impact graph(s) to be plotted. Can be given as a character string of desired node(s) (e.g., c("node1","node2")) or as a numeric vector of column numbers (e.g., c(1,2)).

type.edgeplot

"contrast" returns two separate networks: one for low values of the given node, and one for high values. "single" returns a network where edges represent the edge impact of the given node.

title

if not otherwise specified, title is automatically generated

maximum

sets a maximum for edge thickness (see maximum argument in ?qgraph). "auto" uses the maximum edge from the collective two networks.

...

other plotting specifications (qgraph)

Details

Inputting a edge.impact object will return network plots. Depending on the type.edgeplot argument, two types of networks are possible. Using "contrast" will return "true" estimated networks from the data, separated by a median split on the selected node. Using "single" will return a network where the edges represent the edge impacts for the selected node (e.g., thick positive edges represent a strong positive edge impact)

Examples

Run this code
# NOT RUN {
out <- edge.impact(depression[450:550,1:3])
plot(out, nodes="anhedonia", type.edgeplot="single")
# }
# NOT RUN {
out1 <- edge.impact(depression)
plot(out1, nodes="concentration_problems")
plot(out1, nodes="psychomotor_retardation",
    type.edgeplot="single")

out2 <- impact(depression)
plot(out2$Edge, nodes="concentration_problems")
# }

Run the code above in your browser using DataLab