monthly_pivot: Create monthly pivot summary

Description Usage Arguments Examples

View source: R/monthly_pivot.R

Description

Create monthly pivot summary

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
monthly_pivot(
  data,
  date,
  group_by,
  values_from,
  calc = sum,
  na.rm = TRUE,
  total = FALSE,
  total_name = NULL
)

Arguments

data

data.frame

date

date column name

group_by

column(s) to group the data by

values_from

values column

calc

calculation function (default sum)

na.rm

remove NAs in calculation (default is TRUE)

total

add total column (default FALSE)

total_name

name of total column

Examples

1
monthly_pivot(dplyr::filter(hflights, Date >= '2011-10-01'), date = 'Date', group_by = c("Origin", "Dest"), values_from = "DepDelay", total = TRUE)

DRosenman/helpers documentation built on Dec. 17, 2021, 4:02 p.m.