remove_agg: Remove rows and columns with aggregated data

View source: R/pivot_table.R

remove_aggR Documentation

Remove rows and columns with aggregated data

Description

Aggregated data is recognized because the label of the row or column closest to the array of values is empty.

Usage

remove_agg(pt)

## S3 method for class 'pivot_table'
remove_agg(pt)

Arguments

pt

A pivot_table object.

Details

A pivot table should only contain label rows and columns, and an array of values, usually numeric data.

Removes pivot table rows and columns that contain aggregated data. It only checks the value in the row or column closest to the array of values.

To correctly carry out this operation, the number of rows and columns that contain labels must be defined, and the table must only contain the pivot table rows and columns.

Value

A pivot_table object.

See Also

pivot_table

Other pivot table transformation functions: extract_labels(), fill_labels(), fill_values(), remove_bottom(), remove_cols(), remove_empty(), remove_k(), remove_left(), remove_right(), remove_rows(), remove_top(), replace_dec(), unpivot()

Examples


pt <-
  pt_ex |>
  remove_top(1) |>
  define_labels(n_col = 2, n_row = 2) |>
  remove_agg()


flattabler documentation built on Sept. 15, 2023, 1:06 a.m.