0

The default settings in R create a the plot shown. I need the x axis to be ordered AAA, AA, A+, A, B, C, D, E, F, G, HR. The alphabetical values are credit ratings (variable credrating) and numeric values is the cdr variable.

The code I have is:

plot(credrating, cdr)

enter image description here

Zheyuan Li
  • 71,365
  • 17
  • 180
  • 248
  • you need to use `credrating = factor(credrating, levels=c('AAA','AA', etc.))`. See `?factor` for more info. – C8H10N4O2 Oct 20 '16 at 14:35
  • 1
    @C8H10N4O2 is correct. Next time, however, be sure to include a reproducible example. See some [good guidelines here](http://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example) – nico Oct 20 '16 at 14:48

0 Answers0