remove_columns: Remove Column Containing Specified Entry(s)

View source: R/remove_columns.R

remove_columnsR Documentation

Remove Column Containing Specified Entry(s)

Description

Remove an entire column of a data table whose entries contain a specified value.

Usage

remove_columns(x, index = NULL, search)

Arguments

x

A matrix or data frame. Any 2-dimensional object in R.

index

Deprecated. If selection based on rows is desired, please use dplyr::filter().

search

Numeric or character. The exact match to be searched. If contained within any column or row, it will be removed.

Value

Same class object as x with possibly column(s) removed.

Author(s)

Stu Field

Examples

M <- matrix(1:25, ncol = 5)
M
remove_columns(M, search = 20)
N <- data.frame(M)
N[4, 4] <- "A"
N
remove_columns(N, search = c("A", 17, 23))

stufield/stuRpkg documentation built on April 2, 2022, 2:05 p.m.