Re: [R] Sorting factors

2007-12-21 Thread jim holtman
By default, factors are characters and sorted in alphabetical order. It looks like somehow you numeric data was converted to factors. Therefore '10' comes before '2'. If you want the factors in numeric order you have to convert them back. Look in the FAQs. > x <- c(1,2,3,4,5,10,11,20,21,22,30) >

[R] Sorting factors

2007-12-21 Thread tom sgouros
Hello all: I'm sorry to take up bandwidth with easy questions, but as an R beginner, I continue to be surprised by factors. If someone can shed some light for me, I'd be grateful: > d Total z02801 z02802 z02804 z02806 z02807 z02808 z02809 z02812 z02813 54813 29 51169 236810