Visualize adopters and cumulative adopters
plot_adopters(
obj,
freq = FALSE,
what = c("adopt", "cumadopt"),
add = FALSE,
include.legend = TRUE,
include.grid = TRUE,
pch = c(21, 24),
type = c("b", "b"),
ylim = if (!freq) c(0, 1) else NULL,
lty = c(1, 1),
col = c("black", "black"),
bg = c("tomato", "gray"),
xlab = "Time",
ylab = ifelse(freq, "Frequency", "Proportion"),
main = "Adopters and Cumulative Adopters",
...
)
Either a diffnet object or a cumulative a doption matrix.
Logical scalar. When TRUE frequencies are plotted instead of proportions.
Character vector of length 2. What to plot.
Logical scalar. When TRUE lines and dots are added to the current graph.
Logical scalar. When TRUE a legend of the graph is plotted.
Logical scalar. When TRUE, the grid of the graph is drawn
Integer vector of length 2. See matplot
.
Character vector of length 2. See matplot
.
Numeric vector of length 2. Sets the plotting limit for the y-axis.
Numeric vector of length 2. See matplot
.
Character vector of length 2. See matplot
.
Character vector of length 2. See matplot
.
Character scalar. Name of the x-axis.
Character scalar. Name of the y-axis.
Character scalar. Title of the plot
Further arguments passed to matplot
.
A matrix as described in cumulative_adopt_count
.
Other visualizations:
dgr()
,
diffusionMap()
,
drawColorKey()
,
grid_distribution()
,
hazard_rate()
,
plot_diffnet2()
,
plot_diffnet()
,
plot_infectsuscep()
,
plot_threshold()
,
rescale_vertex_igraph()
# Generating a random diffnet -----------------------------------------------
set.seed(821)
diffnet <- rdiffnet(100, 5, seed.graph="small-world", seed.nodes="central")
#> Warning: The option -copy.first- is set to TRUE. In this case, the first graph will be treated as a baseline, and thus, networks after T=1 will be replaced with T-1.
plot_adopters(diffnet)
# Alternatively, we can use a TOA Matrix
toa <- sample(c(NA, 2010L,2015L), 20, TRUE)
mat <- toa_mat(toa)
plot_adopters(mat$cumadopt)