
Last chance! 50% off unlimited learning
Sale ends in
Summarizes random walk data by computing statistical measures.
summarize_walks(.data, .value, .group_var)summarise_walks(.data, .value, .group_var)
A tibble containing the summarized statistics for each group, including mean, median, range, quantiles, variance, standard deviation, and more.
A data frame or tibble containing random walk data.
A column name (unquoted) representing the value to summarize.
A column name (unquoted) representing the grouping variable.
Steven P. Sanderson II, MPH
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. #' This function summarizes a data frame containing random walk data by computing various statistical measures for a specified value variable, grouped by a specified grouping variable. It checks for necessary attributes and ensures that the data frame is structured correctly.
library(dplyr)
# Example data frame
walk_data <- random_normal_walk(.initial_value = 100)
# Summarize the walks
summarize_walks(walk_data, cum_sum, walk_number) |>
glimpse()
summarize_walks(walk_data, y) |>
glimpse()
# Example with missing value variable
# summarize_walks(walk_data, NULL, group) # This will trigger an error.
Run the code above in your browser using DataLab