plot.cascade: Plot a cascade object

Description Usage Arguments Details Value Examples

Description

Allows plotting of one or multiple, labeled or unlabeled cascades.

Usage

1
2
## S3 method for class 'cascade'
plot(x, label_nodes = TRUE, selection = NULL, ...)

Arguments

x

object of class cascade to be plotted.

label_nodes

logical, indicating if should the nodes in each cascade be labeled. If the cascades are very dense setting this to FALSE is recommended.

selection

a vector of cascade ids to plot.

...

additional arguments passed to plot.

Details

The function returns a ggplot plot object (class gg, ggplot) which can be modified like any other ggplot. See the ggplot documentation and the examples below for more details.

Value

A ggplot plot object.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
data(cascades)
plot(cascades, selection = names(cascades$cascade_nodes)[1:5])
plot(cascades, label_nodes = FALSE, selection = sample(1:54, 20))

# Modify resulting ggplot object
library(ggplot2) 
p <- plot(cascades, label_nodes = FALSE, selection = sample(1:54, 20))
## Add a title
p <- p + ggtitle('Your Title')
p
## Change Axis
p <- p + xlab("Your modified y axis label") #x and y labels are flipped here
p <- p + ylab("Your modified x axis label") #x and y labels are flipped here
p

desmarais-lab/NetworkInference documentation built on May 15, 2019, 5:05 a.m.