On 02/06/2020 3:45 p.m., Tim Keitt wrote:
I have an RMarkdown vignette in a package that uses Rcpp and depends on BH.
I added BH to the Suggests list. It is still generating warnings about BH.
What is the correct way to handle this?

If a package is listed in Suggests, it should still work (possibly with diminished capabilities) when that package is not present. So at the start of your vignette you could have something like

if (!require("BH")) {
message("This vignette needs BH; since it is not installed, code will not be executed.")

  # Set default for chunk option "exec" to FALSE in all code chunks.

Duncan Murdoch

R-package-devel@r-project.org mailing list

Reply via email to