remove_attribute_all: Remove attribute "All"

Description Usage Arguments Examples

View source: R/dimensions.R

Description

This function removes the aggregate segment "All" for specified dimensions. If no dimensions are specified, it removes the segment "All" from all dimensions

Usage

1

Arguments

tbl

A metric tbl in wide format, with one or more dimensions.

...

Dimensions from which "All" should be removed, as bare names or select helpers like contains().

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
library(dplyr)

mtcars_by_cyl_gear <- mtcars %>%
  cross_by_dimensions(cyl, gear, vs) %>%
  summarize(avg_mpg = mean(mpg))

mtcars_by_cyl_gear %>%
  remove_attribute_all()

mtcars_by_cyl_gear %>%
  remove_attribute_all(cyl)

mtcars_by_cyl_gear %>%
  remove_attribute_all(-cyl, -gear)

datacamp/tidymetrics documentation built on March 21, 2021, 3:28 a.m.