I need to plot a graph where the X values are all names -e.g. states of America
and the Y values are numberic and in descending order- e.g. population of the states of America.
Currently, when I use the plot function, it plots a graph but a) The Y values are not in descending order and b) the X Axis displays a bunch of ascending numbers, not the names of the states.
Thanks for the help.
EDIT:
I was using R’s data sets: state.name and state.area
>state.name
[1]"Alabama" etc
>state.area
[1] 51609 etc
my actual data is very similar so I was just playing around with those.
Trial.Group Mean Heart Rate Upper Confidence Interval Lower Confidence Interval
33subj-Male 80 120 70
Sounds like you want a barchart (or maybe a dotplot). There are 3 different plotting systems in R; here are solutions in order of preference.
EDIT:
I made the bars horizontal in order to make it easier to read the labels.