Skip to content
Back to formatted view

Raw Message

Message-ID: <2d1547b0-4f32-1ecf-84d3-7260e085727c@gmail.com>
Date: 2020-06-02T19:53:17Z
From: Duncan Murdoch
Subject: [R-pkg-devel] Vignette depends on BH
In-Reply-To: <CANnL8gomGto=u6VEsqck83a8V1LLGPeRYp5-qPfrVdVOC9A=VQ@mail.gmail.com>

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