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

Error: fn must be an R function with conflict_prefer #46

Closed
DanChaltiel opened this issue Sep 6, 2019 · 1 comment
Closed

Error: fn must be an R function with conflict_prefer #46

DanChaltiel opened this issue Sep 6, 2019 · 1 comment

Comments

@DanChaltiel
Copy link

I cannot use the conflict_prefer function at all, while it works perfectly on my collegue's computer. Here is my call of the first example in the help:

library(conflicted)
conflict_prefer("filter", "dplyr")

Tthis throws this error:

[conflicted] Removing existing preference
[conflicted] Will prefer stats::filter over any other package
Error: fn must be an R function, not a primitive function

Here is the error trace:

> rlang::last_error()
<error>
message: `fn` must be an R function, not a primitive function
class:   `rlang_error`
backtrace:
 1. conflicted::conflict_prefer("filter", "stats")
 2. conflicted:::conflicts_register()
 3. conflicted::conflict_scout(pkgs)
 4. conflicted:::map2(names(conflicts), conflicts, superset_principle)
 5. base::mapply(.f, .x, .y, MoreArgs = list(...), SIMPLIFY = FALSE)
 7. conflicted:::is_superset(fun, non_base, base = base)
 8. rlang::fn_fmls(base_obj)
 9. rlang:::check_closure(fn)
Call `rlang::last_trace()` to see the full backtrace

> rlang::last_trace()
    x
 1. \-conflicted::conflict_prefer("filter", "stats")
 2.   \-conflicted:::conflicts_register()
 3.     \-conflicted::conflict_scout(pkgs)
 4.       \-conflicted:::map2(names(conflicts), conflicts, superset_principle)
 5.         \-base::mapply(.f, .x, .y, MoreArgs = list(...), SIMPLIFY = FALSE)
 6.           \-(function (fun, pkgs) ...
 7.             \-conflicted:::is_superset(fun, non_base, base = base)
 8.               \-rlang::fn_fmls(base_obj)
 9.                 \-rlang:::check_closure(fn)

> packageVersion("conflicted")
[1] ‘1.0.4’

> session_info()
- Session info ------------------------------------------------------------
 setting  value                       
 version  R version 3.5.2 (2018-12-20)
 os       Windows >= 8 x64            
 system   x86_64, mingw32             
 ui       RStudio                     
 language (EN)                        
 collate  French_France.1252          
 ctype    French_France.1252          
 tz       Europe/Paris                
 date     2019-09-06                  

- Packages ----------------------------------------------------------------
#[... a lot of packages...]
@DanChaltiel DanChaltiel changed the title Error: fn must be an R function Error: fn must be an R function with conflict_prefer Sep 6, 2019
@DanChaltiel DanChaltiel changed the title Error: fn must be an R function with conflict_prefer Error: fn must be an R function with conflict_prefer Sep 6, 2019
@dwhdai
Copy link

dwhdai commented Dec 11, 2019

Any fix for this?

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

2 participants