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

Closed
HughParsonage opened this issue Aug 29, 2018 · 2 comments
Labels
bug an unexpected problem or unintended behavior rd-translation 🎏
Milestone

Comments

@HughParsonage
Copy link

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: https://hughparsonage.github.io/pkgdown-masking-eg/reference/in_range.html

Full package to reproduce: https://github.com/HughParsonage/pkgdown-masking-eg

R/in_range.R

#' 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
@jayhesselberth jayhesselberth added this to the pkgdown 1.2.0 milestone Oct 25, 2018
@hadley hadley added bug an unexpected problem or unintended behavior rd-translation 🎏 labels Nov 6, 2018
@hadley
Copy link
Member

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)

@hadley
Copy link
Member

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 as completed in 8c49d4d Nov 8, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug an unexpected problem or unintended behavior rd-translation 🎏
Projects
None yet
Development

No branches or pull requests

3 participants