[R] as.ordered

Birgit Lemcke birgit.lemcke at systbot.uzh.ch
Mon Oct 8 18:50:41 CEST 2007


Hello Members,

I try to convert variables in a data.frame (bract.awn) in the class  
ordered.

str(bract.awn)
'data.frame':	348 obs. of  2 variables:
$ bracts.length.relative.to.flower...............Min: Factor w/ 4  
levels "1","2","3","4": 2 3 3 3 3 2 1 4 3 2 ...
$ bract.awn.relative.to.body.................Max    : Factor w/ 4  
levels "1","2","3","4": 1 3 2 1 4 1 1 1 1 1


I tried this:

bract.awn<-as.ordered(bract.awn)

Fehler in sort.list(unique.default(x), na.last = TRUE) :
   'x' must be atomic for 'sort.list'
Have you called 'sort' on a list?

What am I doing wrong?

Thanks a lot in advance.

Regards

Birgit



Birgit Lemcke
Institut für Systematische Botanik
Zollikerstrasse 107
CH-8008 Zürich
Switzerland
Ph: +41 (0)44 634 8351
birgit.lemcke at systbot.uzh.ch



More information about the R-help mailing list