subset_walks | R Documentation |
This function subsets random walks to identify the walk with the maximum or minimum value.
subset_walks(.data, .type = "max", .value = "y")
.data |
A data frame containing random walks. It must have columns |
.type |
A character string specifying the type of subset: "max" for maximum value, "min" for minimum value, or "both" for both maximum and minimum values. |
.value |
A character string specifying the column name to use for finding extreme values. Defaults to "y". |
The subset_walks
function takes a data frame containing random
walks and subsets it to return the walk with the maximum or minimum value
based on the specified type. It requires that the input data frame contains
columns walk_number
and the specified value column.
A data frame containing the subset walk.
Steven P. Sanderson II, MPH
Other Utility Functions:
confidence_interval()
,
convert_snake_to_title_case()
,
generate_caption()
,
get_attributes()
,
rand_walk_column_names()
,
rand_walk_helper()
,
running_quantile()
,
std_cum_max_augment()
,
std_cum_mean_augment()
,
std_cum_min_augment()
,
std_cum_prod_augment()
,
std_cum_sum_augment()
set.seed(123)
df <- rw30()
subset_walks(df, .type = "max")
subset_walks(df, .type = "min")
subset_walks(df, .type = "both")
# Example with a specific value column
set.seed(123)
discrete_walk() |>
subset_walks(.type = "both", .value = "cum_sum_y") |>
visualize_walks(.pluck = 2)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.