Once a release is ready, all tests done and documentation checked, the Makefile in inst/doc
is run. I usually run one target at a time starting with make movetovignettes
. Before doing this, I build the User Guide and run it through a few compressors: Adobe and then https://github.com/atsa-es/pdfsizeopt-readme.
#devtools::install_github("ropensci/spelling")
spelling::spell_check_package()
allfils <- c("README.md", "DESCRIPTION", "NEWS.md")
fils <- dir("inst/userguide/manual_files", full.names = TRUE)
fils <- fils[stringr::str_detect(fils, "Rnw")]
allfils <- c(allfils, fils)
fils <- dir("inst/derivations", full.names = TRUE)
fils <- fils[stringr::str_detect(fils, "Rnw")]
allfils <- c(allfils, fils)
fils <- dir("vignettes", full.names = TRUE)
fils <- fils[stringr::str_detect(fils, "Rmd")]
allfils <- c(allfils, fils)
fils <- dir("man", full.names = TRUE)
fils <- fils[stringr::str_detect(fils, "Rd")]
allfils <- c(allfils, fils)
spelling::spell_check_files(fils, ignore = spelling::get_wordlist(pkg = "."), lang = "en_US")
Docs are in inst/derivations
. Re-run if the derivation files change. Running the make file will update the inst/derivations/doc
folder which is used for the files that are put in the inst/doc
folder of a source file .tar.gz release.
cd inst/derivations
make
Re-run with any new release. Running the make file will update the inst/userguide/doc
folder which is used for the files that are put in the inst/doc
folder of a source file .tar.gz release.
cd inst/userguide
make
You can update both by
cd inst
make --makefile=Makedoc
Will be in inst/userguide/doc
and inst/derivations/doc
https://github.com/atsa-es/pdfsizeopt-readme
Should be about 1.3M
So that users install the vignettes when they install from GitHub
setwd("~/Documents/GitHub")
devtools::build_manual(pkg="MARSS")
Run and check and then delete the detritus.
[ ] Run this vignettes/versiontest.R
[ ] Run checks on the built package
rm -r ~/Dropbox/MARSS.Rcheck
R CMD check --timings --as-cran MARSS_3.11.7.tar.gz
tests/testthat/model.R
to set up models for testsA note about these tests. I tried to break MARSS code with the tests and choose models and data that are difficult and weird. The tests will pump out many errors and warnings. Don't worry about that. Just watch if the test fails.
You can run all the tests with devtools::test()
but I find running the tests one by one in RStudio is easier to make sense of since there are so many error messages. Open the test file and you will see a button to run tests. Some tests will show errors, but all tests should pass. Errors are correct if the test passes and result should be try-error.
These are the tests in tests/testthat
. All should pass but some give warnings. See note test-GDF-example
for a comment regarding differences on different OS.
[ FAIL 0 | WARN 8 | SKIP 0 | PASS 57 ]
This will warn about "MARSSparamCIs: No parSigma element returned by Hessian function. See marssMLE object errors (MLEobj$errors)". This is ok.
[ FAIL 0 | WARN 0 | SKIP 0 | PASS 76 ]
There will be some errors. This is correct. Test is to make sure these error messages appear.
[ FAIL 0 | WARN 0 | SKIP 0 | PASS 18 ]
This one shows not insignificant differences in the logLik tests (fails) when run on my MacBook Air (M1, 2020) versus my old Mac (Intel) or on a Linux (Posit.Cloud R 4.3, everything updated). If run on Linux, then everything should pass as the logLik hard coded values are from that OS.
[ FAIL 0 | WARN 0 | SKIP 0 | PASS 45 ]
This has the code from the inst/manual_files/KFAS.Rnw
however the se.fit
for output from predict()
for KFAS models is removed because this is expected to be different. See the KFAS chapter at the end of the User Guide.
[ FAIL 0 | WARN 0 | SKIP 0 | PASS 68 ]
This is testing that kfss and kfas are returning the same values across a variety of models.
[ FAIL 0 | WARN 0 | SKIP 0 | PASS 160 ]
Lots of residuals warnings on this one as these are difficult models. "MARSSresiduals.tt1 reported warnings. See msg element of returned residuals object."" Warnings are correct, but all tests should pass. I kind of went overkill on the tests here.
[ ] test-print [ FAIL 0 | WARN 0 | SKIP 0 | PASS 120 ]
[ ] test-residualsHarvey [ FAIL 0 | WARN 0 | SKIP 0 | PASS 84 ]
There will be some warnings about MARSSresiduals.tT reporing warnings.
[ ] test-structTS [ FAIL 0 | WARN 0 | SKIP 0 | PASS 5 ]
[ ] test-tt [ FAIL 0 | WARN 0 | SKIP 0 | PASS 4403 ]
A long kind of excessive test but in 3.11.4 I was having trouble with the tt residuals code.
revdepcheck::revdep_check(num_workers = 4)
cd inst
make
However I usually run it one target at a time.
Now using the final tar.gz file do the final tests.
cd ~/Dropbox
rm -r ~/Dropbox/MARSS.Rcheck
R CMD check --timings --as-cran MARSS_3.11.7.tar.gz
devtools::check_win_devel()
rhub::check_for_cran()
cran-comments.md
urlchecker::url_check()
Re-read the submission guidelines to see if anything changed: https://cran.r-project.org/submit.html
Check that package builds on Windows
Upload package to CRAN
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.