I have a list of files. I also have a list of \"names\" which I substr() from the actual filenames of these files. I would like to add a new column to each of t
substr()
data_lst <- list( data_1 = data.frame(c1 = 1:3, c2 = 3:1), data_2 = data.frame(c1 = 1:3, c2 = 3:1) ) f <- function (data, name){ data$name <- name data } Map(f, data_lst , names(data_lst))