I´ve asked for this on R-help one week ago, no answer until now… I´ve got multiple data.frames of gps- and temperature-data within a list. One data.frame looks like:
GPS:
date time x.lat x.lon
1 22.05.11 13:50:37 53.57908 10.034599
2 22.05.11 13:50:38 53.57906 10.034633
temp:
date time temp
1 22.05.11 13:50:38 21.6120
2 22.05.11 13:50:39 21.6070
So I have two lists, one with multiple gps-data.frames and one with multiple temp-dataframes. I used lapply to manipulate both lists, but can´t merge temp and gps to one big list, containing all data.frames, for only time-stamps which exists in both list, like for the above example only 13:50:38 exists in both:
GPS+temp:
date time x.lat x.lon temp
1 22.05.11 13:50:38 53.57906 10.034633 21.6070
For the single data-frames that worked just fine with:
both <- merge(gps,temp)
For the two lists of data.frames I first tried an lapply over both lists…something like
both <- lapply(temp, gps, function(x){x <- merge(x);x})
Then I tried it with
both <- merge.list(gps,temp)
but this doesn´t work either. It just transfers the first list “gps” to both
Try
Map:or just call
mapplylikeMapdoes: