Appending column to a data frame - R
Posted
by
darkie15
on Stack Overflow
See other posts from Stack Overflow
or by darkie15
Published on 2012-08-28T15:03:42Z
Indexed on
2012/08/28
15:38 UTC
Read the original article
Hit count: 347
r
|data.frame
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)
© Stack Overflow or respective owner