I think I\'m looking for an analog of rbind.fill (in Hadley\'s plyr package) for cbind. I looked, but there is no cbind.fill
rbind.fill
plyr
cbind
cbind.fill
We can use a list instead of data.frame and convert it to a data.frame at the end. For instance:
list
data.frame
df = list() df2 = data.frame(col1 = 1:3, col2 = c('a','b','c')) df = as.data.frame(cbind(df, as.matrix(df2))) df # col1 col2 # 1 1 a # 2 2 b # 3 3 c