rjournal / rjtools

Tools for AUTHORS to use for checking and submitting articles to the R Journal
https://rjournal.github.io/rjtools/
Other
31 stars 14 forks source link

Some minor quality-of-life additions #24

Closed wkumler closed 2 years ago

wkumler commented 2 years ago

I'm preparing a manuscript for the R Journal now, and have been super impressed with rjtools as a useful helper. While using it, I noticed a couple things that were easy fixes that improved my quality-of-life while using the package, so this pull request would include these in the package for everyone else.

  1. Edited the error/success messages for check_title().
    • Currently, check_title() gives a recommendation to use toTitleCase() when the title is correctly formatted. This commit moves that recommendation to the error condition rather than the success condition, where it seems to make more sense.
    • I also explicitly specify that toTitleCase() comes from the tools package because it took me a bit to realize that wasn't an rjtools function.
  2. Added NA handling to the check_abstract_before_intro() function
    • In my document, I specify the introduction using \section{Introduction}, which isn't picked up by the check_abstract_before_intro function for some reason. This makes it return NA, which throws an error and stops the workflow with Error in if (abstract < intro) { : missing value where TRUE/FALSE needed
  3. Added an option to check_proposed_package() that allows specifying the package as an argument rather than a user input
    • Purely for convenience, I added an argument to this function that lets you specify the package you're checking rather than waiting for user input via readline. This was nice because I could just run the whole suite of check_XXX functions without needing to manually enter the info each time.
    • Argument has been added with a default of NULL, so this should also work as-is with existing packages.

Package builds and installs nicely on my machine, but R CMD CHECK throws an error because the lazy-load database rjtools.rdb is corrupt but I don't think I touched that, so it shouldn't be an issue.