CRAN notes that files cannot be checked without ‘pandoc’ being installed
Asked Answered
M

2

15

In doing final checks on a CRAN package submission, this NOTE comes up:

* checking top-level files ... NOTE
Files ‘README.md’ or ‘NEWS.md’ cannot be checked without ‘pandoc’ being installed.

However, pandoc is definitely installed as I use it regularly, and this package makes frequent use of it in documentation using pkgdown.

> rmarkdown::pandoc_available()
[1] TRUE
> rmarkdown::pandoc_version()
[1] ‘1.19.2.1’

I want to avoid installing pandoc from source because the latest version of pandoc supercedes the version installed with other R packages and causes weird output.

There is a similar question from a few years back but the solutions there are to either:

  • Install pandoc from source or via the installr package, whereas I already have pandoc installed; and,
  • Place the two files into .Rbuildignore, however both should be accepted with CRAN submissions now.

This note only comes up when checked using devtools::release() and when using devtools::check(check_version = TRUE), which otherwise passes with no warnings or notes.

The RStudio install of Pandoc:

Sys.getenv('RSTUDIO_PANDOC')
[1] "/Applications/RStudio.app/Contents/MacOS/pandoc"

Which I had previously exported to my ~/.bash_profile:

export PATH="$PATH:/Applications/Rstudio.app/Contents/MacOS/pandoc"

Any ideas?

> sessionInfo()
R version 3.4.3 (2017-11-30)
Platform: x86_64-apple-darwin15.6.0 (64-bit)
Running under: macOS High Sierra 10.13.2

Matrix products: default
BLAS: /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libBLAS.dylib
LAPACK: /Library/Frameworks/R.framework/Versions/3.4/Resources/lib/libRlapack.dylib

locale:
[1] en_CA.UTF-8/en_CA.UTF-8/en_CA.UTF-8/C/en_CA.UTF-8/en_CA.UTF-8

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

other attached packages:
[1] cancensus_0.1.6

loaded via a namespace (and not attached):
 [1] Rcpp_0.12.14     rstudioapi_0.7   knitr_1.17       bindr_0.1       
 [5] xml2_1.1.1       magrittr_1.5     roxygen2_6.0.1   devtools_1.13.4 
 [9] R6_2.2.2         rlang_0.1.6      httr_1.3.1       stringr_1.2.0   
[13] dplyr_0.7.4      tools_3.4.3      hunspell_2.9     git2r_0.20.0    
[17] withr_2.1.1      htmltools_0.3.6  rversions_1.0.3  commonmark_1.4  
[21] rprojroot_1.2    yaml_2.1.14      digest_0.6.13    assertthat_0.2.0
[25] tibble_1.3.4     crayon_1.3.4     bindrcpp_0.2     curl_3.1        
[29] evaluate_0.10.1  memoise_1.1.0    glue_1.2.0       rmarkdown_1.8   
[33] stringi_1.1.5    compiler_3.4.3   backports_1.1.0  desc_1.1.1      
[37] jsonlite_1.5     pkgconfig_2.0.1 
Minded answered 20/12, 2017 at 6:31 Comment(4)
Checking on my computer I have two version of pandoc installed with one bundled within Rstudio C:\Program Files\RStudio\bin\pandoc (I am on windows). rmarkdown::pandoc_version( ) checks for the system environment variable PATH as well as the version of pandoc shipped with RStudio and the highest version available is used. Try installing pandoc ?Tenotomy
Try installr::install.pandoc()Kauppi
Isn't that just a garden-variety $PATH problem?Giblet
Did you resolve this?Chamfron
A
5

This happens because devtools::release calls devtools::check with check_version = TRUE.

You can also run devtools::check(check_version = TRUE) to trigger the same note.

I think for this part you would need pandoc on your PATH.

(indeed, after adding the existing ...\RStudio\bin\pandoc to my PATH the note is gone)

Amphictyony answered 17/1, 2018 at 14:31 Comment(2)
I can replicate this, as you described, with devtools::check(check_version = true the note is triggered. However, I believe that I have Rstudio's pandoc in my PATH already in ~/.bash_profile export PATH="$PATH:/Applications/Rstudio.app/Contents/MacOS/pandoc"Minded
I wonder is it sourcing your ~/.bash_profile or maybe you should be using ~/.profile or even ~/.bashrc? It's hard to tell from here and I'm not even a Mac user...Amphictyony
D
1

This question appears to be a duplicate.

Currently no accepted solution at the above linked Q. However, @hrbrmster's suggested solution in that thread: adding the README.md and NEWS.md to the .Rbuildignore remove the NOTES for me.

Current .RBuildignore contents

^pkg_name_here\.Rproj$
^\.Rproj\.user$
^cran-comments\.md$
^CODE_OF_CONDUCT\.md$
^README\.md$
^NEWS\.md$
Deglutition answered 17/4, 2021 at 6:38 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.