Supposing you have all the .csv
files in one folder, the following function will give you what you need:
# defining the function
merged <- function(id = 1:332) {
df <- data.frame()
for(i in 1:length(id)){
add <- read.csv(as.character(paste0(sprintf("%03s",id[i]),".csv")))
df <- rbind(df,add)
}
colnames(df) <- c(..specify the colnames in here..)
assign("dat", df, envir = .GlobalEnv)
}
# getting your merged df
merged(5:130)
The merged dataframes are now in the dataframe dat