drop_columns: Remove columns from a dataframe

Description Usage Arguments Examples

View source: R/drop_columns.R

Description

Use partial matching to select and remove multiple columns from a dataframe.

Usage

1
drop_columns(x, columns)

Arguments

x

A dataframe.

columns

A vector containing part of the column names that are to be removed. Partial matching of the character string will be used. You can use normal regular expressions to describe the name.

Examples

1
2
3
4
5
data <- data.frame(L1 = c("a", "b", "c", "d", "e", "f", "g", "h"),
                  V1 = c(1, 2, 3, 6, 1, 3, 4, 4),
                  V2 = c(3, 4, 5, 3, 5, 5, 3, 2),
                  Z3 = c(6, 7, 4, 2, 3, 2, 7, 6))
 data_trim <- drop_columns(data, "V")

tkostas/komics documentation built on May 24, 2019, 7:31 a.m.