-3

I have 4 dataframe, 1st is having only date and time column, 2nd,3rd,and 4th are having all date,time and species column but only 1st have complete date and time and other don't have, Now I need to merge the 4 together in a single file. I have used the code merge to get them together but it doesn't work.

mydata4 <- merge(mydata0,mydata1,mydata2,mydata3,by= c( "Date","Time"), all=TRUE)

It doesn't work showing error Error in fix.by(by.x, x) : 'by' must specify one or more columns as numbers, names or logical

1 Answers1

2

Is your Date and Time in the same column? What are the dimensions of each data frame?

You should look into the xts package.

First, convert each data frame into a xts object by using as.xts() function and then use merge.xts() function to merge according to Date and Time.

UtdMan
  • 151
  • 2
  • 12