r - Reduce all columns of data.frame to one long vector -
probably quite basic question, can't seem figure out myself.
i have data.frame this:
df <- data.frame(x1=1:4,x2=5:8,x3=9:12)
i create 1 long vector columns, that, example, following:
[1] 1 2 3 4 5 6 7 8 9 10 11 12
how do this?
thanks!
a data.frame
special type of list
, want, can use:
unlist(df, use.names = false) # [1] 1 2 3 4 5 6 7 8 9 10 11 12
Comments
Post a Comment