[R] misleading output after ordering data frame

Rolf Turner rolf at math.unb.ca
Mon Nov 8 18:52:54 CET 2004

You wrote:

> Is there a way to update the row numbers as well? It's not that
> important, but I find it a bit confusing.

	They're not actually row numbers, they're row ***names***.
	These default to row numbers.
	If they were real-live names you'd want them to be carried
	along in the sort.

	To re-set them to be what you want:

		rownames(d) <- 1:nrow(d)


					Rolf Turner
					rolf at math.unb.ca

More information about the R-help mailing list