View source: R/remove_columns.R
remove_columns | R Documentation |
Remove an entire column of a data table whose entries contain a specified value.
remove_columns(x, index = NULL, search)
x |
A matrix or data frame. Any 2-dimensional object in R. |
index |
Deprecated. If selection based on rows is desired, please
use |
search |
Numeric or character. The exact match to be searched. If contained within any column or row, it will be removed. |
Same class object as x
with possibly column(s) removed.
Stu Field
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))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.