remove_undesired: Remove undesired columns from a data table

View source: R/utils-conv.R

remove_undesiredR Documentation

Remove undesired columns from a data table

Description

Remove undesired columns from a data table

Usage

remove_undesired(df, undesired_cols)

Arguments

df

a data table from which to remove columns

undesired_cols

a character vector of column names identifying columns to be removed

Details

This function modifies by reference.

Value

a data table

Examples

x <- data.table::data.table(a = c(1,2,3), b = c(1,2,3), c = c(1,2,3))
orignames <- names(x)
undesired_cols <- c("a","b", "d")
nsqipr:::remove_undesired(x, undesired_cols)
identical(names(x), setdiff(orignames, undesired_cols))


dylanrussellmd/nsqipr documentation built on Oct. 13, 2023, 11:01 a.m.