[R] How do I subset a dataframe

eric ericstrom at aol.com
Sun Aug 14 01:44:21 CEST 2011


I have a dataframe zeespan. One of the columns has the name "customer". The
data in the customer column is text. I would like to return a subset of the
dataframe with all rows that DON'T begin with either "ibm" or "exxon", or
"sears" in the customer column.

I tried ....  subset(zeespan, customer != c("ibm" | "exxon" | "sears") )

That didn't work and even if it did, the text would have to be an exact
match where what I really want is "begins with".

Suggestions on how to do this would be appreciated

--
View this message in context: http://r.789695.n4.nabble.com/How-do-I-subset-a-dataframe-tp3742172p3742172.html
Sent from the R help mailing list archive at Nabble.com.



More information about the R-help mailing list