### 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)
Run the code above in your browser using DataLab