The monstrosity that is as.data.frame(cbind())
strikes again. There is a function for creating data frames. It's called data.frame()
. Use it! ;)
data<-data.frame(data = data,order = order)
data<-arrange(data,order)
When you cbind
a factor (or character) with a numeric vector, as documented in ?cbind
, you'll get a matrix, and hence lots of probably unwanted coercion.