Hello, I'm trying to add a name column to all of the components in my list by using the list's names. That is, I have eight tables in my list, each with its own name: table 1 through eight. So I can unlist them later and tell where the table came from.
This post was read, and the code works. By looping through elements in a vector, R may add columns to dataframes in a list.
Map(cbind, mylist, Cluster = names(mylist)) my list
However, I am perplexed by the Map (). Isn't this the map() function from the Purrr package? map() will take the arguments in the order they are given to it (data, function). I looked up Map in the Rstudio help, and it appears to be much more complex. And if I'm going to use the Purrr map, what should I do?