Hi guys,
I need your help.
I'm trying to sort the data by the variable "obs".
This is how I tried to sort the data below.

The problem is, I have a variable name "obs"; this is.. a counter variable.
something like _n_ in SAS.
I do not know why it is not working.
I even tried a similar example in UCLA webpage:
http://www.ats.ucla.edu/stat/R/faq/sort.htm  :it also does not seem to work.
"*sort1.hsb2 <- hsb2[order(read) , ]"*
Do you have any idea how to deal with this problem??  Thank you so much.
-Hyo

> colnames(ttx1)
 [1] "longitude 1"  "longitude 2"  "longitude 3"  "longitude 4"  "longitude
5"
 [6] "longitude 6"  "longitude 7"  "longitude 8"  "longitude 9"  "longitude
10"
[11] "longitude 11" "longitude 12" "longitude 13" "longitude 14" "longitude
15"
[16] "longitude 16" "longitude 17" "longitude 18" "longitude 19" "longitude
20"
[21] "longitude 21" "longitude 22" "longitude 23" "longitude 24" "longitude
25"
[26] "longitude 26" "longitude 27" "longitude 28" "longitude 29" "longitude
30"
[31] "longitude 31" "longitude 32" "longitude 33" "longitude 34" "longitude
35"
[36] "longitude 36" "longitude 37" "longitude 38" "longitude 39" "longitude
40"
[41] "longitude 41" "longitude 42" "longitude 43" "longitude 44" "longitude
45"
[46] "longitude 46" "longitude 47" "longitude 48" "longitude 49" "longitude
50"
[51] "longitude 51" "longitude 52" "longitude 53" "longitude 54" "longitude
55"
[56] "longitude 56" "longitude 57" "longitude 58" "longitude 59" "longitude
60"
[61] "longitude 61" "longitude 62" "longitude 63" "longitude 64" "longitude
65"
[66] "longitude 66" "longitude 67" "longitude 68" "longitude 69" "longitude
70"
[71] "longitude 71" "longitude 72" "obs"
>
> sortedx1=ttx1[order(-obs),]
Error in order(-obs) : object 'obs' not found

	[[alternative HTML version deleted]]


