Skip to contents

Returns the file path to an R Markdown snippet shipped with this package.

Usage

snip_path(id = ls_file_snips()$id)

Arguments

id

Snippet identifier. One of

  • "_common.Rmd"

  • "coding-style-notice.Rmd"

  • "installation-notice_dev-version.Rmd"

  • "installation-notice_dev-version_gitlab.Rmd"

  • "pkg-config-notice.Rmd"

  • "rmd-package-notice.Rmd"

Value

A path.

Details

The snippets can be used anywhere R Markdown input is supported. For example, you can use them as input to knitr's child document option:

```{r, child = pkgsnip::snip_path("installation-notice_dev-version_gitlab.Rmd")}
```

Or you can use them in roxygen2's @includeRmd tag:

#' @includeRmd `r pkgsnip::snip_path("installation-notice_dev-version_gitlab.Rmd")`

See also

R Markdown file snippet functions ls_file_snips()

Examples

pkgsnip::snip_path("coding-style-notice.Rmd")
#> /tmp/RtmpD90MsI/temp_libpath28a5f35460f29/pkgsnip/snippets/coding-style-notice.Rmd