View source: R/diagnostic_plots.R
ts_random_walk_ggplot_layers | R Documentation |
ggplot2
layersGet layers to add to a ggplot
graph from the ts_random_walk()
function.
ts_random_walk_ggplot_layers(.data)
.data |
The data passed to the function. |
Set the intercept of the initial value from the random walk
Set the max and min of the cumulative sum of the random walks
A ggplot2
layers object
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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.