A function to help build random walks by mutating a data frame.
Usage
rand_walk_helper(.data, .value)
Value
A modified data frame/tibble with the following columns added:
cum_sum: Cumulative sum of y.
cum_prod: Cumulative product of y.
cum_min: Cumulative minimum of y.
cum_max: Cumulative maximum of y.
cum_mean: Cumulative mean of y.
Arguments
.data
The data frame to mutate.
.value
The .initial_value to use. This is passed from the random walk
function being called by the end user.
Author
Steven P. Sanderson II, MPH
Details
A function to help build random walks by mutating a data frame. This mutation
adds the following columns to the data frame: cum_sum, cum_prod, cum_min,
cum_max, and cum_mean. The function is used internally by certain functions
that generate random walks.
See Also
Other Utility Functions:
convert_snake_to_title_case(),
generate_caption()