Skip to Content

Appending column to a data frame - R

Is it possible to append a column to data frame in the following scenario?

dfWithData <- data.frame(start=c(1,2,3), end=c(11,22,33))
dfBlank <- data.frame()

..how to append column start from dfWithData to dfBlank?

It looks like the data should be added when data frame is being initialized. I can do this:

dfBlank <- data.frame(dfWithData[1])

but I am more interested if it is possible to append columns to an empty (but inti)