[R] Need to merge multiple data frames with time stamp

Kevin Schiesser kevin.schiesser at xoom.com
Fri Oct 18 19:52:08 CEST 2013


Merge has an option 'all', when set to 'TRUE' merge will return a
data.frame of every row in both data.frames. You can also specify all.x,
and all.y.

I do not suggest taking this path. Rather, standardize time columns for
all 15 data.frames with as.POSIXct()/as.POSIXlt() depending on the input
time format.

-Kevin

On 10/18/13 04:37 , "Sandeep.Sampara at ril.com" <Sandeep.Sampara at ril.com>
wrote:

Hi,

 

I'm trying to combine 15 different data frames but all have time field as
common. But the thing is time intervals are different (like min's and
sec's).

So I have to check the common time from all the 15 data frames and merge it
to a single data frame and then export it to excel or csv.

I tried with below query but it's not giving exact output. It's almost 5
year of data, but its giving output for 3months only.

Please help with your query to get my output.

 

a <- merge(MA2DHPA,MA2DHPB,by="IP_Trend_Time")

b <- merge(MA2UCPA,MA2UCPB,by="IP_Trend_Time")

c <- merge(MA2DCPA,MA2DCPB,by="IP_Trend_Time")

d <- merge(MA2DHTA,MA2DHTB,by="IP_Trend_Time")

e <- merge(MA2UCTA,MA2UCTB,by="IP_Trend_Time")

f <- merge(MA2DCTA,MA2DCTB,by="IP_Trend_Time")

g <- merge(MA2CP,MA2CPS,by="IP_Trend_Time")

h <- MA2AP

 

x <- merge(a,b,by="IP_Trend_Time")

y <- merge(c,d,by="IP_Trend_Time")

z <- merge(e,f,by="IP_Trend_Time")

w <- merge(g,h,by="IP_Trend_Time")

 

x1 <- merge(x,y,by="IP_Trend_Time")

y1 <- merge(z,w,by="IP_Trend_Time")

 

MA2 <- merge(x1,y1,by="IP_Trend_Time")

 

Regards,

Sandeep S|IT&C,
Reliance Industries Limited (E&P) | Onshore Terminal | Gadimoga
*  +91 884 2977066 / 9908130749

 

Please consider the environment before printing this email.

 


---------------------------------------------------------------------------------
The information transmitted in this email is intended on...{{dropped:9}}



More information about the R-help mailing list