You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This may just be inexperience but my use of the tabyl function is frequent and I find myself always wanting to have the columns sorted based on the adorn_total values for each column.
This will be best solved outside of janitor. Here's one I came up based on the first StackOverflow hit from my search. I had to modify that one since in a tabyl, the left-most column is descriptive and should stay on the left. With your example:
x <- diamonds %>%
tabyl(clarity, cut) %>%
adorn_totals(c("col")) %>%
arrange(desc(as.numeric(Total))) %>%
adorn_totals(c("row"))
x[, c(1, order(-x[nrow(x),-1]) + 1)] # the 1s and -1 is to work around the first column being character
Brief description of the problem
This may just be inexperience but my use of the tabyl function is frequent and I find myself always wanting to have the columns sorted based on the adorn_total values for each column.
The text was updated successfully, but these errors were encountered: