I am trying to merge two datasets using this function:
USA<-merge(USAdata,dow,by="Date",all=T)
When running it I run into the problem that the merge happens but the number of rows double, I've already successfully used this function to merge other data sets without any problems, and always by="Date".
Can someone help please ?
Here are the datasets : https://drive.google.com/drive/folders/1KoG85vzZQ1R_C3mjXyRHyJJb4Cy6krKj?usp=sharing
P.S I'm a total beginner
You have Date class as character and in different format in dow. Change it to date class and then merge the data.
Date
dow
merge
dow$Date <- as.Date(dow$Date, '%m/%d/%Y') USA <- merge(USAdata, dow, by="Date", all=TRUE)
1.4m articles
1.4m replys
5 comments
57.0k users