I'm trying to create a geom bar, and order it in descending order. I'm not assigning any Y value to aesthetics, just X. Y value automatically takes the number of times that appear in the rows, as the variable count (showin in the geom bar).
Where I can find the value of 'count'? When I try to order the bars with reoder() function, it asks for a Y value. If I put count, it says 'arguments must have the same lenght'
#unordered
ggplot(data=gtd_top, aes( x = country_txt)) +
geom_bar()
#ordered, does not work
ggplot(data=gtd_top, aes( x = reorder(country_txt, count), y = count)) +
geom_bar()