I have made 3 data frames and then put them into a list using the command given below
# create 3 data frames
bag <- round(data.frame(v1=rnorm(10),v2=rnorm(10,1,2)),2)
book <- data.frame(a1=rnorm(10),a2=rnorm(10,1,2),a3=rep("NA",10))
table <- round(data.frame(c1=rnorm(10),c2=rnorm(10,1,2)),2)
# create a list
list1 <- setNames(lapply(ls(pattern="bag|book|table"), function(x) get(x)), ls(pattern="bag|book|table"))
I have performed some operations on the data frames with in the list and want to extract the data frames back into individual frames like they were before going into the list. I am looking for a solution where I do not have to mention the names of the data frames again but instead use the same. For example, the first df in the list should be extracted in df named "book" and same for others. I can extract them one-by-one and rename them but this step looks redundant and do not think is efficient.
I will appreciate any help towards a solution.
Thanks.