Re: [R] Ordering a matrix (and not losing the rownames)

2013-09-02 Thread arun
Hi Ramón, It is for the column index. For ex: tags_totals[order(tags_totals[,1],decreasing=TRUE),1,drop=FALSE] #same as previous solution as there is only one column.  #   [,1] #Grupos   23 #Wikis    15 #Glosarios    11 #Bases de datos    7 #Taller    5

Re: [R] Ordering a matrix (and not losing the rownames)

2013-08-30 Thread arun
Hi Ramón, May be this helps: tags_totals<-matrix(c(15,11,23,7,5),ncol=1,dimnames=list(c("Wikis","Glosarios","Grupos","Bases de datos","Taller"),NULL)) tags_totals[order(tags_totals[,1],decreasing=TRUE),,drop=FALSE] #   [,1] #Grupos   23 #Wikis    15 #Glosarios    1