Learn R Programming

networktools (version 1.1.0)

plot.expectedInf: Plot "expectedInf" objects

Description

Convenience function for plotting expected influence

Usage

# S3 method for expectedInf
plot(x, order = c("given", "alphabetical", "value"),
  zscore = TRUE, ...)

Arguments

x

an output object from an expectedInf (class expectedInf)

order

"alphabetical" orders nodes alphabetically, "value" orders nodes from highest to lowest impact value

zscore

logical. Converts raw impact statistics to z-scores for plotting

...

other plotting specifications (ggplot2)

Details

Inputting an object of class expectedInf will return a line plot that shows the relative one-step and/or two-step expected influence of each node.

Examples

Run this code
# NOT RUN {
out1 <- expectedInf(myNetwork)
plot(out1$step1)
# }
# NOT RUN {
plot(out1, order="value", zscore=TRUE)

igraph_obj <- igraph::graph_from_adjacency_matrix(cor(depression))
ei_igraph <- expectedInf(igraph_obj)

qgraph_obj <- qgraph::qgraph(cor(depression), plot=FALSE)
ei_qgraph <- expectedInf(qgraph_obj)

Ising_adj_mat <- IsingFit::IsingFit(social, plot=FALSE)$weiadj
ei_Ising <- expectedInf(Ising_adj_mat)
plot(ei_Ising)
# }

Run the code above in your browser using DataLab