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

Problem with function %in% in version 5.1.0 #343

Closed
efcaguab opened this issue Mar 25, 2018 · 1 comment
Closed

Problem with function %in% in version 5.1.0 #343

efcaguab opened this issue Mar 25, 2018 · 1 comment

Comments

@efcaguab
Copy link

Hi there. After the recent update to 5.1.0 there is some really strange error when a function calls %in% in the code. Both when calling drake::drake_config or drake::make, I get: Error in collector$functionHandlers: object of type 'closure' is not subsettable.

A nearly (minimal) code below. Although note that the error still shows up when dplyr is not loaded.

library(drake)
library(dplyr)

x <- function(){
  mtcars %>%
    filter(as.character(mpg) %in% c("21"))
}

plan <- drake_plan(a = x)

drake_config(plan)
make(plan)

Session information below:

R version 3.4.2 (2017-09-28)
Platform: x86_64-apple-darwin15.6.0 (64-bit)
Running under: macOS High Sierra 10.13.3

Matrix products: default
BLAS: /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libBLAS.dylib
LAPACK: /Library/Frameworks/R.framework/Versions/3.4/Resources/lib/libRlapack.dylib

locale:
[1] en_NZ.UTF-8/en_NZ.UTF-8/en_NZ.UTF-8/C/en_NZ.UTF-8/en_NZ.UTF-8

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

other attached packages:
[1] dplyr_0.7.4 drake_5.1.0

loaded via a namespace (and not attached):
 [1] Rcpp_0.12.15       compiler_3.4.2     pillar_1.1.0       formatR_1.5       
 [5] plyr_1.8.4         bindr_0.1          R.methodsS3_1.7.1  R.utils_2.6.0     
 [9] tools_3.4.2        testthat_2.0.0     digest_0.6.15      jsonlite_1.5      
[13] lubridate_1.7.2    evaluate_0.10.1    tibble_1.4.2       pkgconfig_2.0.1   
[17] rlang_0.2.0        igraph_1.1.2       rstudioapi_0.7     yaml_2.1.16       
[21] parallel_3.4.2     bindrcpp_0.2       withr_2.1.1.9000   stringr_1.3.0     
[25] storr_1.1.3        knitr_1.20         htmlwidgets_1.0    CodeDepends_0.5-3 
[29] globals_0.11.0     rprojroot_1.3-2    tidyselect_0.2.4   glue_1.2.0        
[33] listenv_0.7.0      R6_2.2.2           future.apply_0.1.0 XML_3.98-1.10     
[37] purrr_0.2.4        magrittr_1.5       htmltools_0.3.6    backports_1.1.2   
[41] codetools_0.2-15   assertthat_0.2.0   future_1.7.0       stringi_1.1.6     
[45] visNetwork_2.0.3   crayon_1.3.4       R.oo_1.21.0   

Thanks & keep up the good work. I really love this package!

@wlandau
Copy link
Member

wlandau commented Mar 25, 2018

Thanks for the report and the encouragement. I am almost positive this is another instance of #268 and possibly related to duncantl/CodeDepends#17 and duncantl/CodeDepends#26. The error should vanish if you replace filter() with dplyr::filter() or update to the latest development version of CodeDepends on GitHub (for onlookers, devtools::install_github("duncantl/CodeDepends")).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants