[R] How to add a legend to a goodness-of-fit plot (vcd:goodfit)?

David Breimann david.breimann at gmail.com
Sun Aug 28 10:56:15 CEST 2011


Hello,

Sample code:

library("vcd")
dummy <- rnbinom(200, size=1.5, prob=0.8)
gf <- goodfit(dummy, type="nbinomial", method="MinChisq")
plot(gf)

I would like to:
1. add a lgened stating the bars show the actual counts and the red
dots - the fit.
2. show the goodness-of-fit values calculated somewhere on an empty
white space ob the plot.

But... the legend command does not work.

Any help?

Thanks,
Dave



More information about the R-help mailing list