View source: R/stats-walk-summary.R
| summarize_walks | R Documentation |
Summarizes random walk data by computing statistical measures.
summarize_walks(.data, .value, .group_var = NULL)
summarise_walks(.data, .value, .group_var = NULL)
.data |
A data frame or tibble containing random walk data. |
.value |
A column name (unquoted) representing the value to summarize. |
.group_var |
An optional column name (unquoted) representing the grouping
variable. Defaults to |
This function requires that the input data frame contains a
column named 'walk_number' and that the value to summarize is provided.
It computes statistics such as mean, median, variance, and quantiles
for the specified value variable. Omit .group_var or set it to NULL
for an overall summary, ignoring any existing grouping on the input.
Supply a grouping column to summarize only by that column.
Dimension metadata is read from dimensions, falling back to the legacy
dimension attribute. If neither is present, dimensions is NA_integer_.
A tibble containing the summarized statistics for each group, including mean, median, range, quantiles, variance, standard deviation, and more.
Steven P. Sanderson II, MPH
library(dplyr)
# Example data frame
walk_data <- random_normal_walk(.initial_value = 100)
# Summarize by walk
summarize_walks(walk_data, cum_sum_y, walk_number) |>
glimpse()
# Overall summary (omitted grouping and explicit NULL are equivalent)
summarize_walks(walk_data, y) |>
glimpse()
summarize_walks(walk_data, y, .group_var = NULL) |>
glimpse()
# Example with missing value variable
# summarize_walks(walk_data, NULL, group) # This will trigger an error.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.