ts_random_walk_ggplot_layers {healthyR.ts} | R Documentation |
Get Random Walk ggplot2
layers
Description
Get layers to add to a ggplot
graph from the ts_random_walk()
function.
Usage
ts_random_walk_ggplot_layers(.data)
Arguments
.data |
The data passed to the function. |
Details
Set the intercept of the initial value from the random walk
Set the max and min of the cumulative sum of the random walks
Value
A ggplot2
layers object
Author(s)
Steven P. Sanderson II, MPH
Examples
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)
[Package healthyR.ts version 0.3.1 Index]