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

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

c# - Better 64-bit byte array hash -

python - PyCharm Type error Message -