I have extracted chosen columns from multiple files into new as many data sets as files. Now I need to rbind all of them into a single column in a new file.
I am using below command
comments <- bind_rows(data1,data2,data3,data4,data5,data6,data7)
We can change the column names all at once in a
list and then apply
library(dplyr) lapply(mget(paste0("data", 1:7)), setNames, "Col1") %>% bind_rows()
data.table which will give a single column
library(data.table) rbindlist(mget(paste0("data", 1:7))