Description Usage Arguments Examples
Use partial matching to select and remove multiple columns from a dataframe.
1 | drop_columns(x, columns)
|
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. |
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")
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.