gavinsimpson / gratia

ggplot-based graphics and useful functions for GAMs fitted using the mgcv package
https://gavinsimpson.github.io/gratia/
Other
206 stars 28 forks source link

JOSS review: code points #305

Closed vankesteren closed 3 months ago

vankesteren commented 3 months ago

Hey @gavinsimpson,

congrats on your submission to JOSS! This is an issue coming out of the JOSS review here. Here is a checklist for points relating to your code / documentation.

I haven't yet had the time to go over the other documentation (it's a lot!), but will try to do so ASAP.

gavinsimpson commented 3 months ago

@vankesteren Thanks for the comments/review

gavinsimpson commented 3 months ago

Why draw() and why not the ggplot2 built-in generic autoplot()? That is for example used in packages like fpp3. I feel like adding an additional generic is maybe overkill? You could have also overloaded plot.gam() (although I do appreciate the issues with that so that may be a bad idea). I also realize that your code is already widely used so that may hinder changing something so fundamental about your API.

I thought about this a lot having used autoplot() for a unreleased (i.e. not-on-cran) package ggvegan that extends ggplot graphics to vegan's plots. I really don't like the name autoplot(), not least that it is 4 characters too many to type; not being able to extend ggplot() was, IMHO, a mistake in the implementation but I understand the reasons why; plot() is for base R graphics and I think it is a mistake to use that generic for ggplot-based graphics.

I appreciate that draw is an new generic, but it's pretty clearly signposted and used consistently across the package, including in the intro materials.

So this one I'm not going to fix/change.

gavinsimpson commented 3 months ago

@vankesteren I have addressed each of the remaining points. If the changes do not go far enough, reopen this and I can take another stab.