Hi R com.
I have this piece of code:
mutate(SalesAmount = SalesPrice*SalesQty) %>%
summarize(sum_sale = sum(SalesAmount, na.rm = TRUE)) %>%
geom_bar(aes(x = reorder(ItemId, sum_sale, FUN = desc),
y = sum_sale), stat = "identity") +
But i have like 1000+ products and all i want is to look at the top 10 ItemId, the reorder function is not really helping me here unless there is a cool way of taking the top 10 Itemid based on SalesAmount and sort them. Any ideas?