I reordered my values in ggplot2:
KR %>% ggplot(aes(x= reorder(categories, -n), n, fill = categories, order =
categories)) + geom_bar(stat = "identity") + (axis.title.x=element_blank(),
axis.text.x=element_blank(), axis.ticks.x=element_blank())
Now I want that the fill
values have the same order as the values on the x-axis. I tried it with order
but it doesn't work.
str(KR)
Classes ‘tbl_df’, ‘tbl’ and 'data.frame': 20 obs. of 2 variables:
$ categories: chr "Food" "Nightlife" "Bars" "American (Traditional)" ...
$ n : int 8576 6334 6067 5312 5250 5229 5220 4118 3868 3673 ...