cbind

cbind a dataframe with an empty dataframe - cbind.fill?

ぃ、小莉子 提交于 2019-11-25 23:47:20
问题 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 . What I want to do is the following: #set these just for this example one_option <- TRUE diff_option <- TRUE return_df <- data.frame() if (one_option) { #do a bunch of calculations, produce a data.frame, for simplicity the following small_df small_df <- data.frame(a=1, b=2) return_df <- cbind(return_df,small_df) } if (diff_option) { #do a bunch of calculations,