pivot_drill: Drill into a hierarchy dimension

Description Usage Arguments Examples

View source: R/pivot-drill.R

Description

Drill into a hierarchy dimension

Usage

1
pivot_drill(.data, ...)

Arguments

.data

A data.frame or a pivot_prep object

...

Variable or variables to drill by

Examples

1
2
3
4
5
6
7
retail_orders %>%
  pivot_rows(order_date = dim_hierarchy(
    year = as.integer(format(orderdate, "%Y")),
    month = as.integer(format(orderdate, "%m"))
  )) %>%
  pivot_values(sum(sales)) %>%
  pivot_drill(order_date)

edgararuiz/pivotable documentation built on Nov. 18, 2019, 7:49 a.m.