Skip to content

Removing columns from data frame

1 message · Bill Venables

#
I'm not sure of precisely what you don't want to use (or why) but here is
one way

newDataFrame <- oldDataFrame[ , - match(namesToGo, names(oldDataFrame))]

Bill Venables
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-help-request at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._