Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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 
like image 915
dshkol Avatar asked Dec 20 '17 06:12

dshkol


People also ask

How do I install Pandoc in R?

Using the R package installr , and then run installr::install. pandoc() . It will automatically install the Windows msi and add the PATH for you. You may review the user path in environment variables: C:\Users\user_name\AppData\Local\Pandoc\ .

Where is Pandoc installed Mac?

The pandoc executable will be placed in $HOME/.cabal/bin on linux/unix/macOS and in %APPDATA%\cabal\bin on Windows. Make sure this directory is in your path. If you also want the pandoc-server executable, add -fserver to the above command.

Is Pandoc an R package?

GitHub - cderv/pandoc: R package to install, manage and run Pandoc (https://pandoc.org/)

How do I update Pandoc in R?

Simply use open -a Finder /Applications/RStudio. app/Contents/MacOS/pandoc/ to open the folder where Pandoc used by Rstudio is stored. Copy the new Pandoc (by open -a Finder A/B/C , the code in the first step of Yihui's solution, as shown above.) and paste it to /Applications/RStudio.


1 Answers

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)

like image 198
RolandASc Avatar answered Sep 27 '22 20:09

RolandASc