Something like: > df3 <- df2[ !(df2$date %in% df1$date), ]
Might be what you want. -- Gregory (Greg) L. Snow Ph.D. Statistical Data Center Intermountain Healthcare [email protected] 801.408.8111 > -----Original Message----- > From: [email protected] [mailto:r-help-boun...@r- > project.org] On Behalf Of GL > Sent: Wednesday, February 10, 2010 12:26 PM > To: [email protected] > Subject: [R] Subscripting > > > Dataframe1 contains a list of specific dates. Dataframe2 contains a > large > dataset, one element of which is Date. How do I create a subset of > Dataframe2 that excludes the dates from Dataframe1? I know how to do it > with > a left outer join vs null in SQL, but I can't figure out how to do it > more > directly via the subcripts that already exist? > > Dateframe1 > > Date > 1/1/2010 > 1/18/2010 > > > Dataframe2 > > Date Attribute Count > 1/1/2010 Red 5 > 1/15/2010 Green 2 > 1/18/2010 Purple 8 > 1/19/2010 Yellow 3 > > ResultingDataframe (Dataframe2 minus the rows that have Dates in > Dataframe1) > > Date Attribute Count > 1/15/2010 Green 2 > 1/19/2010 Yellow 3 > > -- > View this message in context: http://n4.nabble.com/Subscripting- > tp1476330p1476330.html > Sent from the R help mailing list archive at Nabble.com. > > ______________________________________________ > [email protected] mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide http://www.R-project.org/posting- > guide.html > and provide commented, minimal, self-contained, reproducible code. ______________________________________________ [email protected] mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.

