Learn R Programming

flattabler (version 1.0.0)

remove_empty: Remove empty rows and columns from a pivot table

Description

Remove rows and columns without data from the pivot table represented by the object.

Usage

remove_empty(pt)

# S3 method for pivot_table remove_empty(pt)

Arguments

pt

A pivot_table object.

Value

A pivot_table object.

Details

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

All rows and columns not belonging to the pivot table must be removed, including those without data.

Examples

Run this code
# NOT RUN {
library(tidyr)

pt <- pt_m4 %>% remove_empty()

pt <- pt_ine2871 %>% remove_empty()

# }

Run the code above in your browser using DataLab