Hi Suzanna,
I think you lost your variable names somewhere along the way. Another way
of doing this is to use the order() command:
o <- order(var1, decreasing=T)
sorted <- cbind(var1[o], var2[o])
sorted
Best,
Ian
On Sat, 29 Apr 2006, Suzanna Chapman wrote:
Hi again,
Holger has helped me with code suggestions but they are still not running
for me on my computer. Can anyone spot my error?
object<-cbind(var1,var2)
object<-as.matrix(object)
object[sort(object$var1, decreasing=T)[1:10],object$var2]
The first two lines of code run, and I create the matrix object with 2
columns and 3000 rows - but I can't get the next line to run, what I want
is to sort the rows in decreasing values of var1, such that the name for
that county (var2) also moves with it.
Thanks again,
Suzanna
On Sat, 29 Apr 2006, ghumphr(a)fas.harvard.edu wrote:
Does anyone know of a good package for making
directed graphs in LaTeX?
_______________________________________________
gov2001-l mailing list
gov2001-l(a)lists.fas.harvard.edu
http://lists.fas.harvard.edu/mailman/listinfo/gov2001-l
_______________________________________________
gov2001-l mailing list
gov2001-l(a)lists.fas.harvard.edu
http://lists.fas.harvard.edu/mailman/listinfo/gov2001-l