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

后端 未结 2 721
孤独总比滥情好
孤独总比滥情好 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:24

    Put it in Suggests: of your DESCRIPTION file.

    From p. 6 of the R extensions manual:

    The ‘Suggests’ field uses the same syntax as ‘Depends’ and lists packages that are not necessarily needed. This includes packages used only in examples, tests or vignettes (see Section 1.4 [Writing package vignettes], page 26), and packages loaded in the body of functions. E.g., suppose an example from package foo uses a dataset from package bar. Then it is not necessary to have bar use foo unless one wants to execute all the examples/tests/vignettes: it is useful to have bar, but not necessary. Version requirements can be specified, and will be used by R CMD check.

提交回复
热议问题