ggplot2
R/diagnostic_plots.R
ts_random_walk_ggplot_layers.Rd
Get layers to add to a ggplot graph from the ts_random_walk() function.
ggplot
ts_random_walk()
ts_random_walk_ggplot_layers(.data)
The data passed to the function.
A ggplot2 layers object
Set the intercept of the initial value from the random walk
Set the max and min of the cumulative sum of the random walks
Steven P. Sanderson II, MPH
library(ggplot2) df <- ts_random_walk() df %>% ggplot( mapping = aes( x = x , y = cum_y , color = factor(run) , group = factor(run) ) ) + geom_line(alpha = 0.8) + ts_random_walk_ggplot_layers(df)