Concatenate two columns of a data frame in R
We can transpose (
) the dataset and then concatenate (
) the output
as.vector(t(df1)) # "a1" "b1" "a2" "b2" "a3" "b3"
Usually used to convert 'data.frame' to 'vector'
, but it will be written off column by column. This is the reason for migrating the dataset and using
you can use to get the output
source to share