I have many variables that I have created using code like this:
for (i in 1:10) {
assign(paste0("variable", i), i )}
I now need to use rbind on the variables to combine them. I tried something like this to no avail:
rbind(assign(paste0("variable", 1:10)))
Any suggestions on what to do?
That is the wrong way to handle related items. Better to use a list or dataframe, but you will probably find out why in due course. For now:
Or:
I would like to add another way to merge multiple dataframes with dynamic names. This will be accomplished by using
mget
andbind_rows
fromdplyr
.