Search code examples
rdevtools

How do I access any NOTEs that might appear while checking a package?


While running R CMD check, one can receive an Error, a Warning, or a NOTE. I'd like to check if a NOTE was generated and if so access the contents of the NOTE programmatically.

My goal is to see if a NOTE was generated that indicates the submission does not yet exist on CRAN. I know there are other ways to check that, but it seems a shame to reinvent the wheel since devtools::check() already generates a message if that is the case.


Solution

  • Well, R is open source, and this comes from the file src/library/tools/R/build.R. So why not start there?

    edd@max:~/src/debian/R/R-2.15.1/src/library/tools/R$ grep '"NOTE' build.R 
        resultLog(Log, "NOTE")
                         sprintf("NOTE: There were %d notes.\n",
                         sprintf("NOTE: There was 1 note.\n"))
    edd@max:~/src/debian/R/R-2.15.1/src/library/tools/R$