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

added variable plots returns error when model formula contains inline functions #3

Closed
aravindhebbali opened this issue Jun 2, 2017 · 1 comment

Comments

Projects
None yet
1 participant
@aravindhebbali
Copy link
Member

commented Jun 2, 2017

> library(caret)
Loading required package: lattice
Loading required package: ggplot2
> data("Sacramento")
> lm_fit1 <- lm(log(price)  ~ . - city, data = Sacramento)
> ols_avplots(lm_fit1)
Error in eval(predvars, data, env) : object 'price' not found
Called from: eval(predvars, data, env)
> sessionInfo()
R version 3.4.0 (2017-04-21)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows >= 8 x64 (build 9200)

Matrix products: default

locale:
[1] LC_COLLATE=English_India.1252  LC_CTYPE=English_India.1252   
[3] LC_MONETARY=English_India.1252 LC_NUMERIC=C                  
[5] LC_TIME=English_India.1252    

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

other attached packages:
[1] caret_6.0-76    ggplot2_2.2.1   lattice_0.20-35 olsrr_0.1.0    

loaded via a namespace (and not attached):
 [1] Rcpp_0.12.7          compiler_3.4.0       nloptr_1.0.4        
 [4] plyr_1.8.4           iterators_1.0.8      tools_3.4.0         
 [7] pkgload_0.0.0.9000   pkgbuild_0.0.0.9000  digest_0.6.10       
[10] goftest_1.0-3        lme4_1.1-11          memoise_1.0.0.9001  
[13] tibble_1.2           nlme_3.1-125         gtable_0.2.0        
[16] mgcv_1.8-17          Matrix_1.2-9         foreach_1.4.3       
[19] rstudioapi_0.6       DBI_0.5-1            parallel_3.4.0      
[22] SparseM_1.7          gridExtra_2.0.0      withr_1.0.2         
[25] dplyr_0.5.0          stringr_1.1.0        devtools_1.12.0.9000
[28] MatrixModels_0.4-1   stats4_3.4.0         grid_3.4.0          
[31] nnet_7.3-12          nortest_1.0-4        R6_2.2.1            
[34] minqa_1.2.4          tidyr_0.6.0          purrr_0.2.2         
[37] reshape2_1.4.2       car_2.1-2            magrittr_1.5        
[40] scales_0.4.1         codetools_0.2-15     ModelMetrics_1.1.0  
[43] MASS_7.3-47          splines_3.4.0        assertthat_0.2.0    
[46] pbkrtest_0.4-6       colorspace_1.2-7     quantreg_5.19       
[49] stringi_1.1.2        lazyeval_0.2.0       munsell_0.4.3

@aravindhebbali aravindhebbali added the bug label Jun 2, 2017

@aravindhebbali aravindhebbali self-assigned this Jun 2, 2017

@aravindhebbali aravindhebbali added this to the v0.2.0 milestone Jun 5, 2017

aravindhebbali added a commit that referenced this issue Jun 5, 2017

@aravindhebbali

This comment has been minimized.

Copy link
Member Author

commented Jun 5, 2017

ols_avplots() now works with inline functions.

library(olsrr)
library(caret)
data("Sacramento")
model <- lm(log(mpg) ~ disp + hp + wt, data = mtcars)
olsrr::ols_avplots(model)

avplot

Session Info

> sessionInfo()
R version 3.4.0 (2017-04-21)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows >= 8 x64 (build 9200)

Matrix products: default

locale:
[1] LC_COLLATE=English_India.1252  LC_CTYPE=English_India.1252   
[3] LC_MONETARY=English_India.1252 LC_NUMERIC=C                  
[5] LC_TIME=English_India.1252    

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

other attached packages:
[1] caret_6.0-76        ggplot2_2.2.1       lattice_0.20-35     olsrr_0.1.1        
[5] testthat_1.0.2.9000

loaded via a namespace (and not attached):
 [1] Rcpp_0.12.7        nloptr_1.0.4       compiler_3.4.0     plyr_1.8.4        
 [5] iterators_1.0.8    tools_3.4.0        goftest_1.0-3      lme4_1.1-11       
 [9] pkgload_0.0.0.9000 tibble_1.2         gtable_0.2.0       nlme_3.1-125      
[13] mgcv_1.8-17        Matrix_1.2-9       foreach_1.4.3      DBI_0.5-1         
[17] parallel_3.4.0     SparseM_1.7        gridExtra_2.0.0    withr_1.0.2       
[21] dplyr_0.5.0        stringr_1.1.0      MatrixModels_0.4-1 stats4_3.4.0      
[25] grid_3.4.0         nnet_7.3-12        nortest_1.0-4      R6_2.2.1          
[29] minqa_1.2.4        tidyr_0.6.0        purrr_0.2.2        reshape2_1.4.2    
[33] car_2.1-2          magrittr_1.5       splines_3.4.0      scales_0.4.1      
[37] codetools_0.2-15   ModelMetrics_1.1.0 MASS_7.3-47        assertthat_0.2.0  
[41] pbkrtest_0.4-6     colorspace_1.2-7   labeling_0.3       quantreg_5.19     
[45] stringi_1.1.2      lazyeval_0.2.0     munsell_0.4.3      crayon_1.3.2 
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.