Description Usage Arguments Value Author(s) References See Also Examples
Drop (or keep) all columns containing a vector of strings
1 | drop.columns(string, data, drop = TRUE)
|
string |
The string (or vector of strings) to be kept or omitted. |
data |
The dataset |
drop |
Logical. Should the columns containing |
a dataset with the column(s) dropped or kepts
Dustin Fife
http://stackoverflow.com/questions/7597559/grep-in-r-with-a-list-of-patterns
1 2 3 4 5 6 7 8 | ### drop all columns with the words "Length"
data(iris)
iris.dropped = drop.columns("Length", data=iris, drop=TRUE)
### keep only those columns with HemoLeptin in the string
data(fakeMedicalData)
medical = drop.columns("HemoLeptin", data=fakeMedicalData, drop=FALSE)
head(medical)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.