Roxygen2: handle except clauses in import statements?

Created on 31 Mar 2017  ·  4Comments  ·  Source: r-lib/roxygen2

Is it possible to write an @import directive that produces

import(foo, except=c(bar,baz))

as in 1.5.2 of https://cran.r-project.org/doc/manuals/r-release/R-exts.html

With roxygen2 6.0.1.9000 @importFrom(foo, except=c(bar,baz)) produces an unusable NAMESPACE file.

Most helpful comment

You can always use @rawNamespace for this:

#' @rawNamespace import(shiny, except = runExample)
#' @rawNamespace import(shinyjs, except = runExample)

This seems to elevate the requirements for your package to >= R 3.3.0, but otherwise works fine for me.

All 4 comments

You can always use @rawNamespace for this:

#' @rawNamespace import(shiny, except = runExample)
#' @rawNamespace import(shinyjs, except = runExample)

This seems to elevate the requirements for your package to >= R 3.3.0, but otherwise works fine for me.

Hello,
I would like to import rlang without the := method. What would the syntax be in this case?

#' @rawNamespace import(rlang, except =  :=)
#' @rawNamespace import(rlang, except =  ":=")
#' @rawNamespace import(rlang, except =  `:=`)

All these lines give an unexpected assignment error.

Thank you

@duccioa This is a closed issue, and comments on long closed issues often go unnoticed.

#' @rawNamespace import(rlang, except = ":=")
NULL

generates the right NAMESPACE for me:

...
import(rlang, except = ":=")
...

Please open a new issue, with a reproducible example. Thanks!

Thank you for your quick reply.

Was this page helpful?
0 / 5 - 0 ratings