0

I have three csv files of the same information. Each data set consist of the same columns of information. Each csv file is from different year and I want to combine all together and analyze using R. I’m a beginner at this and would appreciate some pointers to how to do this.

Thank you.

Rsm_242
  • 1
  • 1
  • 1
    Hello, Rsm, it is better if you share a minimal code sample, no matter how basic it looks. By the way: if you load three dataframes (i.e. with `read.csv`) with the same columns, say, `df1` , `df2`, `df3`, you can merge them as `df <- rbind(df1,df2,df3)` – Ric Dec 27 '22 at 00:41
  • Be sure to [research](https://meta.stackoverflow.com/questions/261592/how-much-research-effort-is-expected-of-stack-overflow-users) before you ask especially on basic, often asked questions! Cheers! – Parfait Dec 27 '22 at 04:04

1 Answers1

0
library(dplyr)
library(readr)

#import and merge all three CSV files into one data frame
df <- list.files(path='C:/your/path/to/files') %>% 
  lapply(read_csv) %>% 
  bind_rows
S-SHAAF
  • 1,863
  • 2
  • 5
  • 14