remove_undesired | R Documentation |
Remove undesired columns from a data table
remove_undesired(df, undesired_cols)
df |
a data table from which to remove columns |
undesired_cols |
a character vector of column names identifying columns to be removed |
This function modifies by reference.
a data table
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))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.