Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

In examples, unexported functions cause 'masking' from other packages' exported functions #789

HughParsonage opened this issue Aug 29, 2018 · 2 comments


Copy link

@HughParsonage HughParsonage commented Aug 29, 2018

If a package contains a function that is not exported, but conflicts with the namespace of a package attached in an example, the rendered example will spuriously warn about the attached package masking an object in the package.

For example:

Full package to reproduce:


#' In range
#' @param x,a,b Inputs
#' @examples
#' library(dplyr)
#' in_range(1, 0, 2)
#' @export 
in_range <- function(x, a, b) all(between(x, a, b))

# Just to confuse dplyr
between <- function(y, a, b) y >= a & y <= b
Copy link

@hadley hadley commented Nov 6, 2018

Long-term fix is #749

Short-term fix: update arguments to devtools::load_all() (and replace with pkgload() while I'm in there)


Copy link

@hadley hadley commented Nov 8, 2018

Thinking about this more I think this reveals a problem with the namespace of your package, but I think we shouldn't be loading unexported functions anyway.


@hadley hadley closed this in 8c49d4d Nov 8, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
3 participants