Re: [R] Fuzzy merge using timestamps

2010-11-10 Thread Ian Craig
The sorting for the times is below: checkTime <- checkTimes[order(checkTimes$ARC,checkTimes$times, decreasing = FALSE),] After the merging data frame is created I use these two commands to merge the checkTime data frame with the other two dataframes: data_gps <- merge(gpsdata,match, by= c("gpsAR

Re: [R] Fuzzy merge using timestamps

2010-11-10 Thread Sarah Goslee
Hi Ian, Did you see the second part of my request, for a simple reproducible example? At the very least, we need your merge and sort code, since it sounds like that's where the problem truly lies. Sarah On Wed, Nov 10, 2010 at 2:02 PM, Ian Craig wrote: > So here is a sample of the datasets.  I

Re: [R] Fuzzy merge using timestamps

2010-11-10 Thread Ian Craig
So here is a sample of the datasets. I have modified them for the purposes of circulating to solve this problem. I have already added the ID and key as seen in the code below. Any ideas? gpsdata gpsARC Protocol TrackUTCDate UTCTime LocalDate LocalTimey x Altitude_m Speed

[R] Fuzzy merge using timestamps

2010-11-10 Thread blurg
Let it be know I am still a neophyte in the R-community forum world, so please don't flame me too bad. I have two sets of data, each with a set of timestamps. I would like to somehow merge the datasets based on the timestamps and an individual identifier. That is there are several individual

Re: [R] Fuzzy merge using timestamps

2010-11-10 Thread Sarah Goslee
On Wed, Nov 10, 2010 at 12:57 PM, Ian Craig wrote: > Greetings Supreme Council of R Masters, Nice. :) > I have two sets of data, each with a set of timestamps.  I would like to > somehow merge the datasets based on the timestamps and an individual > identifier.  That is there are several individ

[R] Fuzzy merge using timestamps

2010-11-10 Thread Ian Craig
Greetings Supreme Council of R Masters, Like toddler, I have gotten my head stuck in the banisters of R ... again. Let it be know I am still a neophyte in the R-community forum world, so please don't flame me too bad. I have two sets of data, each with a set of timestamps. I would like to someh

[R] Fuzzy merge using timestamps

2010-11-08 Thread blurg
Greetings Supreme Council of R Masters, Like toddler, I have gotten my head stuck in the banisters of R ... again. Let it be know I am still a neophyte in the R-community forum world, so please don't flame me too bad. I have two sets of data, each with a set of timestamps. I would like to so

Re: [R] fuzzy merge

2008-04-09 Thread Alberto Monteiro
ravi wrote: > > d3<-merge(d1,d2,by.x=time1,by.y=time2) > will work only for exact matching. One possible option is to match > the times for the date and hour times only (by filtering away the > minute data). But this is only a partial solution as I am not > interested in data where the time di

Re: [R] fuzzy merge

2008-04-09 Thread jim holtman
Here is one way of doing it. Create a new dataframe with the values, look for the breaks in times between the two sequences and then create a results dataframe: > # convert time to POSIXct > d1$time1 <- as.POSIXct(paste(d1[[1]], d1[[2]])) > d2$time2 <- as.POSIXct(paste(d2[[1]], d2[[2]])) > d1$ID1

[R] fuzzy merge

2008-04-09 Thread ravi
Hi, I would like to merge two data frames. It is just that I want the merging to be done with some kind of a fuzzy criterion. Let me explain. My first data frame looks like this : ID1 time1dt 12008-01-02 13:11