Learn R Programming

RandomWalker (version 0.1.0)

summarize_walks: 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)

Value

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

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.

Author

Steven P. Sanderson II, MPH

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.

Examples

Run this code
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