Along with the above solution, another possibility will be to use Reduce, assuming the names as df_1, df_2, ..., df_n:
Reduce(f = function(t1, t2) {rbind(t1, eval(expr = parse(text = t2)))},
x = paste("df", 1:n, sep = "_"),
init = data.frame())
nathania, seeing your answer below (
), can I ask you a question?
Suppose you have data frames (or tibbles) named df_1, ..., df_n, as per the original question. Then, will this method merge the data frames consecutively, i.e. how do you ensure that merging will start with df_1, then df_2, then df_3, and so on?
And, a note: probably ls(pattern = "bad") does the same thing as names(.GlobalEnv) %>% str_subset('bad'). The pattern in the ordering is more understandable, as it is sorted by default.