I have several csv data files that have a common column named "Data". If I read two files from this directory the reading is done correctly:
> P1<-read.csv("02650019.csv", header = TRUE, sep = ";")
> P2<-read.csv("02650032.csv", header = TRUE, sep = ";")
> head(P1)
Data X2650019
1 1986-06-01 0
2 1986-06-02 0
3 1986-06-03 0
4 1986-06-04 0
5 1986-06-05 0
6 1986-06-06 0
> head(P2)
Data X2650032
1 2000-04-01 NA
2 2000-04-02 NA
3 2000-04-03 NA
4 2000-04-04 NA
5 2000-04-05 NA
6 2000-04-06 NA
But when I am going to Merge them by Date, the result appears as if it has two rows of each data and does not appear in the temporal order:
> merge1 <- merge(P1, P2, by = c("Data"), all = T)
> head(merge1)
Data X2650019 X2650032
1 1976-07-01 NA NA
2 1976-07-01 NA NA
3 1976-07-02 NA NA
4 1976-07-02 NA NA
5 1976-07-03 NA NA
6 1976-07-03 NA NA
I do not know what's going on.
I actually wanted to merge all of the csv files I have into my directory and I can not think of a code for that.