Playing around with R, I came across this really weird behavior of the stack()
function :
library(Hmisc)
df = data_frame(col1=c(1,2,3,4,5,6), col2=c(55,66,88,99,22,33))
stack(df) #works like a charm
label(df$col1)="column 1"
label(df$col2)="column 2"
stack(df) #Error in stack.data.frame(df) : no vector column selected
I guess this is caused by class(df[1,1)=="numeric"
at first, but class(df[1,1)=="labelled", "numeric"
at last.
Is there any clean workaround for this ?