Here's a dplyr ( tidyverse ) solution to the OP question on how to reorder strings.
Assuming the data frame is called df , then we can do:
df %>% arrange(rev(rownames(.)))
Explanation: "." the placeholder accepts the entered data frame as a frame. Then rownames(df) become the index vector, 1:nrow(df) . rev arrange and arrange reorders df accordingly.
Without a pipe, the following does the same:
arrange(df, rev(rownames(df)))
If the OP would first convert its dates to Date or POSIX format, as described in the comments, then of course it could just use df %>% arrange(Date) .
But the first method is what answers the OP question.
source share