I’m trying to do a regular reverse sort, but I don’t understand how to do it with an xts
object. I want the last date to be in the first line and not the last.
I tried several ways but it doesn’t work.
library(xts)
x <- rnorm(500) |> cumsum() |> round(1) |>
xts(Sys.time()+1:500) |> to.minutes(name = NULL)
# dont work :(
# x[nrow(x):1,]
# x[order(index(x),decreasing = T),]
# rev(x)