Bar Graph Y Axis Ordering

Newbie here and I am having the darnest time in ggplot ordering my Y axis from least to greatest in a bar graph.

done some poking around and it seems to be a dataFrame issue from my CSV import but I am stumped on a solution

the bar graph is ordering the X axis of person's name alphabetically, which is fine but the Y axis is not in order. how do you order the Y axis descending or create a custom way?

I've tried removing dollar signs, used commas for the dollar figures and even tried decimals to denote the millions and billions but it never orders in numerically.

this is my Y axis

You have to map a numeric variable to the y axis and then you can add formatting within the scale_y_continuous() function, you are getting the y axis alphabetically because the mapped variable is of character class, try converting it to numeric first.

If you need more specific help, please provide a proper REPRoducible EXample (reprex) illustrating your issue.

confused how those numbers are being interpreted as alphabetical on my Y axis? where would I start/how do I convert it from character class to numeric?? I have never done that before...

As I said, I would need you to provide a reprex in order to help you with your specific problem. Please read the guide in the link I gave you and try to provide a proper reproducible example.

Try to use library(scales) for custom this part. Is a good packages for that.

check:

1 Like

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.