Skip to content

Commit

Permalink
Use plain markdown language tag for gated code over eval=FALSE (r-lib…
Browse files Browse the repository at this point in the history
  • Loading branch information
MichaelChirico authored Nov 2, 2023
1 parent ac948f9 commit 9a5bbcd
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions vignettes/namespace.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -85,15 +85,15 @@ The `NAMESPACE` also controls which functions from other packages are made avail

If you are using just a few functions from another package, we recommending adding the package to the `Imports:` field of the `DESCRIPTION` file and calling the functions explicitly using `::`, e.g., `pkg::fun()`.

```{r, eval = FALSE}
```r
my_function <- function(x, y) {
pkg::fun(x) * y
}
```

If the repetition of the package name becomes annoying you can `@importFrom` and drop the `::`:

```{r}
```r
#' @importFrom pkg fun
my_function <- function(x, y) {
fun(x) * y
Expand Down

0 comments on commit 9a5bbcd

Please sign in to comment.