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

are you supposed to use conflicted_prefer() in functions? #7

Closed
beanumber opened this issue Oct 2, 2018 · 5 comments
Closed

are you supposed to use conflicted_prefer() in functions? #7

beanumber opened this issue Oct 2, 2018 · 5 comments
Assignees

Comments

@beanumber
Copy link
Collaborator

Like this: https://github.com/beanumber/fertile/blob/84e85ea4f648f6faf124d0dd56f13576a70a5f5b/R/shims.R#L17

?? @hadley @jennybc

@hadley
Copy link

hadley commented Oct 2, 2018

Definitely not — I'd say ignore conflicted for now (i.e. assume that it's not used), and later on I'll show you a trick for doing this sort of shimming that will trick conflicted.

@beanumber
Copy link
Collaborator Author

Point being, if someone does

library(fertile)
library(tidyverse)

Then fertile won't work right, because readr::read_csv() will have precedent over fertile::read_csv(). So what is the best way to make it so that when fertile loads, it always puts its own shims ahead of the real functions?

@beanumber beanumber reopened this Oct 3, 2018
@beanumber
Copy link
Collaborator Author

Is this what rlang::env_bind() is for?

@beanumber
Copy link
Collaborator Author

@ambertin can you look into a solution for this? How can we make sure that fertile masks the tidyverse functions even if someone loads fertile before tidyverse?

@beanumber
Copy link
Collaborator Author

beanumber commented Feb 12, 2020

Since we're already shimming library() and require(), can we add something like:

library <- function(package, ...) {
  detach("fertile", ...)
  base::library(package, ....)
  base::attach("fertile")
}

??

ambertin pushed a commit to ambertin/fertile that referenced this issue Feb 12, 2020
beanumber added a commit that referenced this issue Feb 13, 2020
fixed search path problem (issue #7)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants