0

I would like to merge all data frames in a list. All dfs have different columns but have "ID" column in common. I would like to merge all dfs on ID but also include IDs that dont match as well. I figure I would have to do an outer merge but am not sure. Can anyone please help with this please? I would like one master csv file with all ID's in the dfs and merge all the ones that overlap.

library("readr")
library("dplyr")
library("plyr")
library("readxl")
library("data.table")

getwd()
setwd("./Users/Desktop/CTRI")
ctri_data <- list.files(path = "/Users/Desktop/CTRI",
                        pattern = "*.csv",              
                        recursive = TRUE,  
                        full.names = TRUE)  


# Read all csv files in the folder and create a list of dataframes
df.list <- lapply(ctri_data , read.csv)
mwc201
  • 1
  • 1

0 Answers0