Learn R Programming

flattabler (version 1.0.0)

remove_cols: Remove columns from a pivot table

Description

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

Usage

remove_cols(pt, c)

# S3 method for pivot_table remove_cols(pt, c)

Arguments

pt

A pivot_table object.

c

A vector of numbers, column numbers.

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 columns not belonging to the pivot table must be removed.

Examples

Run this code
# NOT RUN {
library(tidyr)

pt <- pt_m4 %>% remove_cols(7)

pt <- pt_m4 %>% remove_cols(c(6,7))

# }

Run the code above in your browser using DataLab