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 when using dplyr if list is redefined in a package #37

Open
oganm opened this issue Dec 20, 2018 · 2 comments
Open

Error when using dplyr if list is redefined in a package #37

oganm opened this issue Dec 20, 2018 · 2 comments

Comments

@oganm
Copy link

oganm commented Dec 20, 2018

What I am doing is not exactly good practice anyway but I don't really understand why I am getting an error from strict here.

I have a package that creates a structure named list as list = structure(NA, class = 'result') and exports it. I have isolated this and placed it in this package. What it does isn't really important but when this package is loaded, if I try to use dplyr, I get an error

devtools::install_github('oganm/unpack')
library(strict)
library(unpack)
dplyr::filter(data.frame(a = c(1,2,3)), a == 1)
Error in filter_impl(.data, quo) : Evaluation error: [strict]
Multiple definitions found for `list`.
Please pick one:
 * unpack::list
 * base::list
Call `rlang::last_error()` to see a backtrace.

The code above does not try to use list which made me wonder if it can be avoided and why is it happening in the first place.

@colman-humphrey
Copy link

I'm sure it's that dplyr::filter is using a list under the hood (getting called in structure_filter I think), which would invoke the error. This would mean that strict is working as intended

@oganm
Copy link
Author

oganm commented Feb 4, 2019

But as far as I understand, strict isn't supposed to check the code inside the packages for strictness.

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