From |uc@r @end|ng |rom |edor@project@org  Tue Jun 18 19:38:58 2019
From: |uc@r @end|ng |rom |edor@project@org (=?UTF-8?Q?I=C3=B1aki_Ucar?=)
Date: Tue, 18 Jun 2019 19:38:58 +0200
Subject: [Rd] making a vignette optional
In-Reply-To: <9ecfbe$btcmmv@ironport10.mayo.edu>
References: <9ecfbe$btcmmv@ironport10.mayo.edu>
Message-ID: <CALEXWq1NohT+JGnLaCDb5RKFLQ5ZbWsMUO-HZDEV5+v-Ky0u=g@mail.gmail.com>

On Tue, 18 Jun 2019 at 19:03, Therneau, Terry M., Ph.D. via R-devel
<r-devel at r-project.org> wrote:
>
> I had added a vignette to the coxme package and all worked well locally, but it failed at
> CRAN.     The issue is that the vignette involves using coxme for pedigree data, it
> doesn't work without the kinship2 package, and I hadn't put in the necessary "if
> (require(...." logic.
>
> The question is, how do I make the entire vignette conditional? If the package isn't
> available, there is nothing to run.  The latex itself will fail when it can't find the
> figures  (I float them), and the parts that don't will end up as inane discussion of
> material that isn't there.

This is what I do in my packages:
https://github.com/r-simmer/simmer/blob/master/vignettes/simmer-08-philosophers.Rmd#L21

If SweaveOpts accept code in the same way, you can set something like

\SweaveOpts{eval=requireNamespace("kinship2", quietly=TRUE)}

I?aki



[Rd] making a vignette optional
=?UTF-8?Q?I=C3=B1aki_Ucar?=