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"

  • "pkg-code-style.Rmd"

  • "pkg-config.Rmd"

  • "pkg-desc.Rmd"

  • "pkg-instl-dev-gitlab.Rmd"

  • "pkg-instl-dev.Rmd"

  • "pkgpurl.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("pkg-instl-dev-gitlab.Rmd")}
```

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

#' @includeRmd `r pkgsnip::snip_path("pkg-instl-dev-gitlab.Rmd")`

See also

R Markdown file snippet functions ls_file_snips()

Examples

pkgsnip::snip_path("pkg-code-style.Rmd")
#> /tmp/RtmpZs6SSo/temp_libpath8ab5f3b0d5c8d/pkgsnip/snippets/pkg-code-style.Rmd