Learn R Programming

brainGraph (version 2.2.0)

plot.bg_GLM: Plot GLM diagnostics for a brain network

Description

Plots the GLM diagnostics (similar to that of plot.lm) for the output of brainGraph_GLM. There are a total of 6 possible plots, specified by the which argument; the behavior is the same as in plot.lm. Please see the help for that function.

Usage

# S3 method for bg_GLM
plot(x, region = NULL, which = c(1L:3L, 5L), ...)

Arguments

x

A bg_GLM object

region

Character string specifying which region's results to plot; only relevant if level='vertex' (default: NULL)

which

Integer vector indicating which of the 6 plots to print to the plot device (default: c(1:3, 5))

...

Unused

Value

A list of ggplot objects

See Also

plot.lm

Examples

Run this code
# NOT RUN {
## Save objects and then to multipage PDF
lmPlots <- plot(x)
ggsave('lmPlots.pdf', lmPlots)

## Save all the GLM sub-objects from MTPC analysis
res.mtpc <- mtpc(...)
glmPlots <- lapply(res.mtpc$res.glm, plot, which=1:6)
ml <- marrangeGrob(glmPlots, nrow=1, ncol=1)
ggsave('glmPlots.pdf', ml, width=8.5, height=11)
# }

Run the code above in your browser using DataLab