I have six dataframe (all_road_25, all_road_50, all_road_100,all_road_300, all_road_500, all_road_1000) and all of the data frame contain the same column "site" and another column "length". I want to join all of them by the same column "site" and with the rest columns names showing the original dataframe. So I tried:
all_roads_variables<- list(all_road_25, all_road_50, all_road_100,
all_road_300, all_road_500, all_road_1000) %>%
reduce(full_join, by = "site")
names(all_roads_variables)[2:7] <- c("all_road_25","all_road_50","all_road_100",
"all_road_300", "all_road_500", "all_road_1000 ")
It gives the results I want, but I have to copy all the names of original dataframes by hand. Is there a way of making the scripts shorter?