Skip to content
Prev 13561 / 398502 Next

converting numeric to ordered

On Fri, 14 Sep 2001, Duncan Mackay wrote:

            
It's a matrix. "ordered" is a class. Only data frames can have columns of
different classes.  I think you want
V1 V2 V3
1  0  1  0
2  1  0  1
3  0  1  0

xxx[] <- lapply(xxx, as.ordered)

When ?daisy says

       x: data matrix or dataframe.  Dissimilarities will be computed
          between the rows of `x'.  Columns of mode `numeric' will be
          recognized as interval scaled variables, columns of class
          `factor' will be recognized as nominal variables, and columns
          of class `ordered' will be recognized as ordinal variables.

the comment applies to data frames only.  (Martin: might you clarify
this?)