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

Ben Bolker bbolker at gmail.com
Sun Aug 28 14:50:38 CEST 2011


David Breimann <david.breimann <at> gmail.com> writes:

> 
> 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.
> 

  Please don't cross-post, or if you must explain why ... you
already got an answer on StackOverflow ...

(broken URL to respect Gmane's line length limit)

http://stackoverflow.com/questions/7202163/
how-can-i-add-a-legend-to-a-goodness-of-fit-plot-in-r



More information about the R-help mailing list