Rbind two vectors in R -


i have data.frame several columns i'd join 1 column in new data.frame.

df1 <- data.frame(col1 = 1:3, col2 = 4:6, col3 = 7:9) 

how create new data.frame single column that's 1:9?

since data.frames lists of columns, unlist(df1) give 1 large vector of values. can construct new data.frame it:

data.frame(col = unlist(df1)) 

Comments

Popular posts from this blog

c# - Better 64-bit byte array hash -

webrtc - Which ICE candidate am I using and why? -

php - Zend Framework / Skeleton-Application / Composer install issue -