[R] Question on Merge/Lookup

GL pflugg at shands.ufl.edu
Fri Jan 22 19:52:12 CET 2010


I need to merge three datasets and don't know how. If I were using SQL, I
would use df3, look up the characteristics of each date in df1 and the value
for each observation in df2. 


df1 - unique list of Dates and characteristics of those dates
Date, YYYYMM, YYYYWW, DOW


df2 - the raw data
Date, Place, Value


df3 - all posibile combinations of Date + Place (via
expand.grid(unique(df2$Date),unique(df2$Place))
Date, Place

I need to end up with:

Date, YYYYMM, YYYYWW, DOW, PLace, Value (plug 0 if combo doesn't exist in
raw data).

Appreciate any help!


-- 
View this message in context: http://n4.nabble.com/Question-on-Merge-Lookup-tp1112384p1112384.html
Sent from the R help mailing list archive at Nabble.com.



More information about the R-help mailing list