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"

  • "funky-config.Rmd"

  • "pkg-code-style.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()