diff --git a/vignettes/namespace.Rmd b/vignettes/namespace.Rmd index bcc0c39d..44051681 100644 --- a/vignettes/namespace.Rmd +++ b/vignettes/namespace.Rmd @@ -85,7 +85,7 @@ 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 } @@ -93,7 +93,7 @@ my_function <- function(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