summarize_walks: Summarize Walks Data

View source: R/stats-walk-summary.R

summarize_walksR Documentation

Summarize Walks Data

Description

Summarizes random walk data by computing statistical measures.

Usage

summarize_walks(.data, .value, .group_var)

summarise_walks(.data, .value, .group_var)

Arguments

.data

A data frame or tibble containing random walk data.

.value

A column name (unquoted) representing the value to summarize.

.group_var

A column name (unquoted) representing the grouping variable.

Details

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.

Value

A tibble containing the summarized statistics for each group, including mean, median, range, quantiles, variance, standard deviation, and more.

Author(s)

Steven P. Sanderson II, MPH

Examples

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.


RandomWalker documentation built on Oct. 23, 2024, 5:07 p.m.