kidusasfaw / spatPomp

R package for statistical inference of spatiotemporal partially observed Markov processes
GNU General Public License v3.0
11 stars 10 forks source link

resolve NOTEs in R CMD CHECK --as-cran #8

Closed kingaa closed 2 years ago

kingaa commented 2 years ago

This pull request resolves some of the existing NOTEs generated by R CMD CHECK. In particular, there were many variables defined but not used. I have removed these.

In the process, I caught one coding error that had no consequences (fortuitously). In R/spatPomp.R, the variable mparamnames was defined but not passed to hitch as it should have been. Remarkably, because of the nature of the C-snippet template rendering process, the behavior was nevertheless correct. Despite this, the connection between mparamnames and the templates was obscure and might be the source of confusion in future (not to mention flags at check-time). I have corrected this.

I also uncovered one potential bug. Specifically, in R/spatPomp.R, on line 421, we have

if (missing(unit_accumvars)) accumvars <- data@accumvars

The variable accumvars, if created, is never used. I surmise that this line should read

if (missing(unit_accumvars)) unit_accumvars <- data@accumvars

and have made the corresponding change in the pull request. For convenience, this is a separate commit.

When I do R CMD CHECK on my system, I get another NOTE about examples that take >5s to run. I am not sure why the CRAN checks page does not show this.

To check this on your system, you will need to first install pomp v4.1 from source.

If you do a git diff, you'll see a lot of differences due to changes in whitespace. You can add the -w flag (i.e., git diff -w) to suppress these inconsequential differences.

I'd like to get pomp v 4.1 to CRAN ASAP, so it would be great if we could get this pull request integrated. The plan would then be to upload CRAN, promising that spatPomp will be updated post haste.