I want to automatically sort the data frame based on the last column name. Since the last column name in my data frame will be dynamic, I cannot specify the column name.
Below is what i want to achieve as an output.
iris %>%
select(-Species) %>%
arrange(desc(Petal.Width))
As suggested in response i tried below option, however it dosen't work. Am i missing something?
iris %>%
select(-Species) %>%
arrange(desc(ncol(.)))