[R] "Conditional" match?
ruser2006 at yahoo.com
Fri Jan 27 21:57:07 CET 2006
I have two datasets, big and small.
b_date<- c(2005-12-31, 2005-12-31,
For each row in big, I want to look for a match in
small where two conditions are met:
If match is found, I wish to return the value of the
date. If no match is found, I want NA.
If more than 1 match is found, I wish to return the
match where small$date is greatest.
Im thinking I might be able to do this using the
match function, and by sorting the small dataset by
date_ in descending order.
However, I do not know how to make the match
conditional on big$date_>=small$date_.
Any help is appreciated.
More information about the R-help