yihui / formatR

Format R Code Automatically
https://yihui.org/formatr/
256 stars 52 forks source link

CRAN failures: "there is no package called 'formatR'" #84

Closed kbenoit closed 4 years ago

kbenoit commented 4 years ago

For our package quanteda, we're seeing this problem in all of the windows version checks. My interpretation is that the formatR package is unavailable for these platforms, but it's unclear.

Our package was not breaking like this on the CRAN checks until the 4.0 releases started appearing.

    Warning in block_exec(params) :
     Failed to tidy R code in chunk 'unnamed-chunk-14'. Reason:
    Error in loadNamespace(name) : there is no package called 'formatR'

    Quitting from lines 381-396 (quickstart.Rmd)
    Error: processing vignette 'quickstart.Rmd' failed with diagnostics:
    cannot open the connection
    --- failed re-building 'quickstart.Rmd'

    SUMMARY: processing the following file failed:
     'quickstart.Rmd'

    Error: Vignette re-building failed.
    Execution halted

By filing an issue to this repo, I promise that

I understand that my issue may be closed if I don't fulfill my promises.

yihui commented 4 years ago

formatR is available on all platforms. The problem is you used the chunk option tidy = TRUE in your vignette, but R CMD check assumes only packages declared as dependencies (either soft or hard) are available when it's running.

Please see https://github.com/constantAmateur/SoupX/pull/48 for the fix (SoupX currently has the same problem as your package).

kbenoit commented 4 years ago

Thanks so much for the quick reply, that fixed it!!