I have the following dataframe and Im trying to sort by the Week column but I get the same result.
Actualdf2<-structure(list(Week = structure(1:20, .Label = c("1", "10", "11",
"12", "13", "14", "15", "16", "17", "18", "19", "2", "20", "3",
"4", "5", "6", "7", "8", "9"), class = "factor"), `Actual target` = c(7L,
8L, 4L, 2L, 12L, 37L, 29L, 33L, 31L, 47L, 10L, 12L, 52L, 19L,
19L, 27L, 29L, 18L, 25L, 8L)), row.names = c(NA, 20L), class = "data.frame")
Actualdf2<-Actualdf2[
with(Actualdf2, order(as.numeric(Week))),
]