I have three sets of data tables with different sets of columns. The locationNames.xxx variables have the data set names with common columns.
locationNames.complete <- c("BangsCanyon", "BookCliffs", "Escalante", "Highline", "Ute")
locationNames.noWind <- c("DougPass", "GrandMesa")
locationNames.noT <- c("Palisade", "Pitkin", "Whitewater")
And a variable that has all the data set names.
allSites <- c(locationNames.complete, locationNames.noWind, locationNames.noT)
I do some manipulation on each of these, including a common date
column formatted as POSIXct. I want to merge them all together into one combined
file on date
.
I know about the following approach to merge multiple data sets where the list has the data table names, without quotes.
combined.sites.1 <- Reduce(merge,list(BangsCanyon, BookCliffs, Escalante))
But none of the following approaches work, presumably because the locationNames variables are character.
combined.sites.2 <- Reduce(merge,list(locationNames.complete, locationNames.noWind, locationNames.noT))
combined.sites.2 <- Reduce(merge,list(allSites))
combined.sites.2 <- Reduce(merge,list(get(allSites)))
The last of these three gives a data table that has columns from only the first data table in the allSites variable. I suspect there is something obvious I'm missing.