Learn R Programming

flattabler (version 1.2.0)

remove_rows: Remove rows from a pivot table

Description

Remove the rows whose numbers are indicated from the pivot table represented by the object.

Usage

remove_rows(pt, r)

# S3 method for pivot_table remove_rows(pt, r)

Value

A pivot_table object.

Arguments

pt

A pivot_table object.

r

A vector of numbers, row numbers.

Details

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

All rows not belonging to the pivot table must be removed. It is common to find rows with header or footer information, which must be removed.

See Also

Other pivot table definition functions: define_labels(), divide(), get_page(), remove_bottom(), remove_cols(), remove_empty(), remove_left(), remove_right(), remove_top(), set_page(), view_table_attr()

Examples

Run this code
library(tidyr)

pt <- pt_m4 %>% remove_rows(1)

pt <- pt_m4 %>% remove_rows(c(1, 8, 14, 19, 25, 26))

Run the code above in your browser using DataLab