briandk/granovaGG — pull request #133 by briandk (2011-10-10 01:59:51+00:00)
Title: Should users be able to set NULL values for plot labels?

@rmpruzek [writes][5]:

> The one thing that caused me some consternation concerned changing of the main title
> and the name for the response. I got these to work after some study, and trials, like this:
> =====>
> >rat.1wgg=granovagg.1w(rat[,1],jj=.6,resid=T,group=rep(1:6,ea=10),main="One-way ANOVA display showing weight-gains for six groups of rats",ylab="Weight gains of rats in grams")
> Below are by-group summary statistics of your input data -- these are ok, so I exclude numerics here...
> group group.mean trimmed.mean contrast variance standard.deviation group.size
> > rat.1wgg+title(main="",ylab="")
> =====>
> The resulting graphic is fine w/ this approach. Is this what you would recommend?

The man page for `granova.1w` shows that the classic granova functions had `NULL` default values for many parameters, including `main`, `xlab`, and `ylab`

> ```r
> granova.1w(data, group = NULL, dg = 2, h.rng = 1.25, v.rng = 0.2,
> box = FALSE, jj = 1, kx = 1, px = 1, size.line = -2.5,
> top.dot = 0.15, trmean = FALSE, resid = FALSE, dosqrs = TRUE,
> ident = FALSE, pt.lab = NULL, xlab = NULL, ylab = NULL,
> main = NULL, ...)
> ```
> -- From the `granova.1w` help file

Despite those label defaults being `NULL`, `granova.1w` forces its own default titles onto the plot:

```r
> library(granova)
> data(anorexia.sub)
> astack <- stack(anorexia.sub)
> with(astack, granova.1w(values,
group = ind,
main = NULL,
xlab = NULL,
ylab = NULL
)
)

```

produces this:

[![granova.1w plot where default labels have been enforced][1]][2]

I've included patches in this pull that force granovagg.1w to respect `NULL` values when the user passes them in:

```r
> library(granova)
> data(anorexia.sub)
> astack <- stack(anorexia.sub)
> with(astack, granovagg.1w(values,
group = ind,
main = NULL,
ylab = NULL,
xlab = NULL
)
)
```

produces this:

[![granovagg.1w plot without labels][3]][4]

/cc @WilDoane
[1]: http://f.cl.ly/items/1m0Y0N3e3R0b2k0O2R3q/granova1wNonNullLabels-1.png
[2]: http://cl.ly/161i0i18322X0w1F1h25
[3]: http://f.cl.ly/items/1A0T1P2A3O1D113y2i1z/granovagg1w-no-labels-1.png
[4]: http://cl.ly/3G3f163w3U0E3S3a3q2b
[5]: https://github.com/briandk/granovaGG/pull/128#issuecomment-2337585