I want to merge two dataframes. DF2 has one temperature value for each day while DF1 has several entries for each day. So I want to look up the temperature for one day in DF2 and have it added to every entry of this day in dataframe 1.
I guess a loop would work best but being quite new to R I can't figure out how it has to look like
DF1$Date<-c(1.8.18, 1.8.18, 2.8.18)
DF2$Date<-c(1.8.18, 2.8.18, 3.8.18)
DF2$Temperature<-c(17,18,17)
DF2$Difference<-c(0.5,0.4,0.5)
This is the expected output:
DF1$Date<-c(1.8.18, 1.8.18, 2.8.18)
DF1$Temperature<-c(17,17,18)
DF1$Difference<-c(0.5,0.5,0.4)