Learn R Programming

tikatuwq (version 0.8.2)

resume_wq: Descriptive summaries by group

Description

Computes basic descriptive statistics (mean, median, sd) for all numeric columns in df, grouped by one or more keys.

Usage

resume_wq(df, by = c("ponto", "mes"), funs = c("mean", "median", "sd"))

Value

A tibble with the grouping keys and one column per statistic/variable, named as {var}_{stat} (e.g., od_mean, od_median, od_sd).

Arguments

df

A data frame or tibble.

by

Character vector with grouping column names (default c("ponto","mes")). Any names not present in df are ignored.

funs

Deprecated (kept for compatibility; ignored). The function always computes mean, median and sd with na.rm = TRUE.

Details

  • Grouping columns not found in df are silently dropped.

  • If no grouping columns remain, an error is thrown.

  • Only numeric columns are summarized; if none exist, an error is thrown.

  • Missing values are ignored (na.rm = TRUE).

See Also

Examples

Run this code
# \donttest{
# Using the demo dataset shipped with the package
d <- wq_demo
# Example: group by point (ponto)
s1 <- resume_wq(d, by = "ponto")
head(s1)

# Example: group by point and month (if 'mes' exists in your data)
# s2 <- resume_wq(d, by = c("ponto", "mes"))
# }

Run the code above in your browser using DataLab