David Breimann
2011-Aug-28 08:56 UTC
[R] How to add a legend to a goodness-of-fit plot (vcd:goodfit)?
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
Ben Bolker
2011-Aug-28 12:50 UTC
[R] How to add a legend to a goodness-of-fit plot (vcd:goodfit)?
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