Is it possible to use non-imported packages in a package vignette?

后端 未结 2 695
孤独总比滥情好
孤独总比滥情好 2020-12-31 01:36

I\'m writing a vignette for one of my packages.

In this vignette, I would like to demonstrate how this package can interact with other packages that are not

2条回答
  •  离开以前
    2020-12-31 02:16

    In addition if the vignette properly depends on that package, there should be a

    % \VignetteDepends{...}
    

    statement in the vignette itself: Sweave, Part II: Package Vignettes, R News 3/2 (Oct. 2003), 21 - 24.

    However, your case possibly is a bit different:

    I use if (require ("pkgxy")) without % \\VignetteDepends{pkgxy} (Suggests: pkgxy in the DESCRIPTION is needed anyways) for some things I want to show but where I don't want to force the user to have all the suggested pacakges installed. I put a box at the beginning of the vignette where I report which of those packages are available and if a package is not available when the vignette is built, an "pkgxy is needed to do this" text is put into the vignette.

    The "introduction" vignette of package hyperSpec is an example (to find out how it actually works, you need not only the .Rnw but also some more definitions).

提交回复
热议问题