rbind multiple data sets

r

Solution

You can use `do.call`, like so:

do.call("rbind", list(DF1, DF2, DF3))

Note that second argument of `do.call` is a list.

Problem

I have 3 data sets that I want to rbind together. I have renamed my columns to be the same: ``` names(DF1) <- c("A", "B", "C") names(DF2) <- c("A", "B", "C") names(DF3) <- c("A", "B", "C") ``` They have each got different numbers of observations (34, 54, 23, respectively) However, when I try with an rbind function, it returns the error: ``` total <- rbind(DF1, DF2, DF3) ``` Error in match.names(clabs, names(xi)) : names do not match previous names From other answered questions the error should arise because of differently named columns, but I have checked and rechecked that they have been renamed the same. I would like to end up with a total dataset with a total of 111 observations with column titles. I am a beginner to R, so many of the answers from other questions elude me. Would anyone be able to answer this in layman terms?

Original source

Related problems