How do you join many tables together in R? They all have a date column and then one other variable. The data was collected daily for many years (some since the 1970s when the instruments were first installed).
- df1 contains (date, var1)
- df2 contains (date, var2)
- ...
- df5 contains (date, var5)
The dataframes are of different lengths, depending on the start date for data collection.
I would like a new dataframe (DF6) that contains (date, var1, var2, var3, var4, var5). I expect that there will be a lot of NAs where the variable data is missing for earlier dates from some of the dataframes.
I have tried this:
DF6 <- full_join(df1,df2,df3, df4, df5, by = "date")
but I received this error:
Error in
full_join()
: !suffix
must be a character vector of length 2, not a <data.frame> object of length
Is there something obvious that I'm missing? Is there any easy way to join many dataframes?