I have following data structure after executing a function:
A B C D E
92.08 90.68 54.09 92.87 97.40
F G H I J ...
24.52 67.24 15.63 22.33 45.10 ...
As a final result, I want to have the data in a simple data frame, with letters as rows and values in a column. Following worked, though I'm curious whether this is the most elegant way(?):
output <- data.frame(output)
output <- data.frame(rownames(output), rowSums(output))
colnames(output) <- c("Category", "Value")
output
output %>% arrange(desc(output))
If you have an idea to make it better, feel free to correct me.
dplyr solutions appreciated.
Thanks!