This is rather tricky, and it doesn\'t seem to require the same approach for ordering by a typical column in a data frame. I have something that looks like this:
I've had this problem before. Here's how I solved it. Using some iris
sample data from base R,
> dat <- iris[sample(nrow(iris), 10), ]
> rn <- rownames(dat)
> dat[order(as.numeric(rn)), ]
Ordering by a column should be as simple as:
dataframename[ order(dataframename$row.name) , ]
Notice that your first column is named row.names
but it's not clear if you meant that picture to refer to a dataframe where the rownames were real R rownames and not the first column. Assuming that is that "row.name" == names(dataframename)[1]
. Please check whether this condition is true. At the moment you have given only a picture, whereas it would have been more helpful to provide the results of dput( dataframename[ 1:22, ])