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 unit tests #10

Merged
merged 14 commits into from
Jun 30, 2021
Merged

Added unit tests #10

merged 14 commits into from
Jun 30, 2021

Conversation

adhikars11
Copy link
Collaborator

No description provided.

Copy link
Member

@topepo topepo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The R CMD check results are below. You should try to make sure that everything is passing before a PR (draft or otherwise).

Most of the messages below are due to these issues:

  • You have a lot of empty examples in the documentation. I would just take them out if you don't have them.
  • There a many namespace issues. I would completely import ggplot, rlang, and dplyr. Otherwise, you should namespace everything (i.e., use tune::.get_tune_outcome_names instead of just .get_tune_outcome_names).
    • Most of the "no visible global function definition" notes are related to this.
    • Also, whenever you use a function from the package, it needs to be in the Import field of the DESCRIPTION file. You need to import plotly and rlang
    • Related to ☝️ , don't import tidymodels or tidyverse. Figure out the specific packages that you need and import them.
  • You should document your data objects, even just to say that they are internal objects used for development. See the R packages book for details.
  • There are a few function arguments that are undocumented. I think that this can be solved by using more @inheritParams directives.
==> devtools::check()

ℹ Updating shinymodels documentation
ℹ Loading shinymodels
Registered S3 method overwritten by 'tune':
  method                   from   
  required_pkgs.model_spec parsnip
Warning: [/Users/max/github/shinymodels/R/Misc.R:11] @examples requires a value
Warning: [/Users/max/github/shinymodels/R/Misc.R:34] @examples requires a value
Warning: [/Users/max/github/shinymodels/R/Misc.R:52] @examples requires a value
Warning: [/Users/max/github/shinymodels/R/regression_diag_plots.R:10] @examples requires a value
Warning: [/Users/max/github/shinymodels/R/regression_diag_plots.R:33] @examples requires a value
Warning: [/Users/max/github/shinymodels/R/regression_diag_plots.R:57] @examples requires a value
Warning: [/Users/max/github/shinymodels/R/regression_diag_plots.R:82] @examples requires a value
Warning: [/Users/max/github/shinymodels/R/two_class_diag_plots.R:9] @examples requires a value
Warning: [/Users/max/github/shinymodels/R/two_class_diag_plots.R:38] @examples requires a value
Warning: [/Users/max/github/shinymodels/R/two_class_diag_plots.R:61] @examples requires a value
Warning: [/Users/max/github/shinymodels/R/two_class_diag_plots.R:106] @examples requires a value
Warning: [/Users/max/github/shinymodels/R/two_class_diag_plots.R:149] @examples requires a value
Warning: [/Users/max/github/shinymodels/R/two_class_diag_plots.R:174] @examples requires a value
Writing NAMESPACE
Writing NAMESPACE
── Building ─────────────────────────────────────────────────────────────────────────────────────────── shinymodels ──
Setting env vars:
• CFLAGS    : -Wall -pedantic -fdiagnostics-color=always
• CXXFLAGS  : -Wall -pedantic -fdiagnostics-color=always
• CXX11FLAGS: -Wall -pedantic -fdiagnostics-color=always
──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
✓  checking for file ‘/Users/max/github/shinymodels/DESCRIPTION’ ...
─  preparing ‘shinymodels’:
✓  checking DESCRIPTION meta-information ...
─  checking for LF line-endings in source and make files and shell scripts
─  checking for empty or unneeded directories
─  building ‘shinymodels_0.0.0.9000.tar.gz’
   
── Checking ─────────────────────────────────────────────────────────────────────────────────────────── shinymodels ──
Setting env vars:
• _R_CHECK_CRAN_INCOMING_REMOTE_: FALSE
• _R_CHECK_CRAN_INCOMING_       : FALSE
• _R_CHECK_FORCE_SUGGESTS_      : FALSE
• NOT_CRAN                      : true
── R CMD check ─────────────────────────────────────────────────────────────────
─  using log directory ‘/Users/max/github/shinymodels.Rcheck’
─  using R version 4.1.0 (2021-05-18)
─  using platform: x86_64-apple-darwin17.0 (64-bit)
─  using session charset: UTF-8
─  using options ‘--no-manual --as-cran’
✓  checking for file ‘shinymodels/DESCRIPTION’
─  this is package ‘shinymodels’ version ‘0.0.0.9000’
─  package encoding: UTF-8
✓  checking package namespace information
✓  checking package dependencies (3.8s)
✓  checking if this is a source package ...
✓  checking if there is a namespace
✓  checking for executable files ...
✓  checking for hidden files and directories
✓  checking for portable file names
✓  checking for sufficient/correct file permissions
✓  checking serialization versions ...
✓  checking whether package ‘shinymodels’ can be installed (3.6s)
N  checking installed package size ...
     installed size is  6.6Mb
     sub-directories of 1Mb or more:
       data   6.5Mb
✓  checking package directory ...
✓  checking for future file timestamps (417ms)
N  checking DESCRIPTION meta-information ...
   Malformed Description field: should contain one or more complete sentences.
✓  checking top-level files ...
✓  checking for left-over files ...
✓  checking index information
✓  checking package subdirectories ...
✓  checking R files for non-ASCII characters ...
✓  checking R files for syntax errors ...
✓  checking whether the package can be loaded ...
✓  checking whether the package can be loaded with stated dependencies ...
✓  checking whether the package can be unloaded cleanly ...
✓  checking whether the namespace can be loaded with stated dependencies ...
✓  checking whether the namespace can be unloaded cleanly ...
✓  checking loading without being on the library search path ...
W  checking dependencies in R code (1.8s)
   '::' or ':::' imports not declared from:
     ‘plotly’ ‘rlang’
✓  checking S3 generic/method consistency (950ms)
✓  checking replacement functions ...
✓  checking foreign function calls ...
N  checking R code for possible problems (2.1s)
   first_class_prob_name: no visible global function definition for ‘sym’
   organize_data: no visible global function definition for
     ‘.get_tune_outcome_names’
   organize_data: no visible global function definition for
     ‘collect_predictions’
   organize_data: no visible global function definition for ‘mutate’
   organize_data: no visible global function definition for ‘sym’
   organize_data: no visible binding for global variable ‘.pred’
   organize_data: no visible global function definition for ‘inner_join’
   organize_data: no visible global function definition for ‘add_rowindex’
   organize_data: no visible global function definition for ‘select’
   plot_numeric_obs_pred: no visible global function definition for
     ‘ggplot’
   plot_numeric_obs_pred: no visible global function definition for ‘aes’
   plot_numeric_obs_pred: no visible global function definition for ‘sym’
   plot_numeric_obs_pred: no visible binding for global variable ‘.pred’
   plot_numeric_obs_pred: no visible global function definition for
     ‘geom_abline’
   plot_numeric_obs_pred: no visible global function definition for
     ‘geom_point’
   plot_numeric_obs_pred: no visible binding for global variable ‘.color’
   plot_numeric_obs_pred: no visible global function definition for
     ‘scale_color_identity’
   plot_numeric_obs_pred: no visible global function definition for
     ‘coord_obs_pred’
   plot_numeric_obs_pred: no visible global function definition for ‘labs’
   plot_numeric_obs_pred: no visible global function definition for
     ‘theme_bw’
   plot_numeric_obs_pred: no visible global function definition for
     ‘theme’
   plot_numeric_obs_pred: no visible global function definition for
     ‘ggplotly’
   plot_numeric_res_factorcol: no visible global function definition for
     ‘ggplot’
   plot_numeric_res_factorcol: no visible global function definition for
     ‘aes’
   plot_numeric_res_factorcol: no visible global function definition for
     ‘reorder’
   plot_numeric_res_factorcol: no visible global function definition for
     ‘sym’
   plot_numeric_res_factorcol: no visible binding for global variable
     ‘.residual’
   plot_numeric_res_factorcol: no visible global function definition for
     ‘geom_point’
   plot_numeric_res_factorcol: no visible global function definition for
     ‘geom_abline’
   plot_numeric_res_factorcol: no visible binding for global variable
     ‘.color’
   plot_numeric_res_factorcol: no visible global function definition for
     ‘scale_color_identity’
   plot_numeric_res_factorcol: no visible global function definition for
     ‘coord_obs_pred’
   plot_numeric_res_factorcol: no visible global function definition for
     ‘labs’
   plot_numeric_res_factorcol: no visible global function definition for
     ‘theme_bw’
   plot_numeric_res_factorcol: no visible global function definition for
     ‘theme’
   plot_numeric_res_factorcol: no visible global function definition for
     ‘ggplotly’
   plot_numeric_res_numcol: no visible global function definition for
     ‘ggplot’
   plot_numeric_res_numcol: no visible global function definition for
     ‘aes’
   plot_numeric_res_numcol: no visible global function definition for
     ‘sym’
   plot_numeric_res_numcol: no visible binding for global variable
     ‘.residual’
   plot_numeric_res_numcol: no visible global function definition for
     ‘geom_abline’
   plot_numeric_res_numcol: no visible global function definition for
     ‘geom_point’
   plot_numeric_res_numcol: no visible binding for global variable
     ‘.color’
   plot_numeric_res_numcol: no visible global function definition for
     ‘scale_color_identity’
   plot_numeric_res_numcol: no visible global function definition for
     ‘coord_obs_pred’
   plot_numeric_res_numcol: no visible global function definition for
     ‘labs’
   plot_numeric_res_numcol: no visible global function definition for
     ‘theme_bw’
   plot_numeric_res_numcol: no visible global function definition for
     ‘theme’
   plot_numeric_res_numcol: no visible global function definition for
     ‘ggplotly’
   plot_numeric_res_pred: no visible global function definition for
     ‘ggplot’
   plot_numeric_res_pred: no visible global function definition for ‘aes’
   plot_numeric_res_pred: no visible global function definition for ‘sym’
   plot_numeric_res_pred: no visible binding for global variable
     ‘.residual’
   plot_numeric_res_pred: no visible global function definition for
     ‘geom_abline’
   plot_numeric_res_pred: no visible global function definition for
     ‘geom_point’
   plot_numeric_res_pred: no visible binding for global variable ‘.color’
   plot_numeric_res_pred: no visible global function definition for
     ‘scale_color_identity’
   plot_numeric_res_pred: no visible global function definition for
     ‘coord_obs_pred’
   plot_numeric_res_pred: no visible global function definition for ‘labs’
   plot_numeric_res_pred: no visible global function definition for
     ‘theme_bw’
   plot_numeric_res_pred: no visible global function definition for
     ‘theme’
   plot_numeric_res_pred: no visible global function definition for
     ‘ggplotly’
   plot_twoclass_conf_mat: no visible global function definition for
     ‘augment’
   plot_twoclass_conf_mat: no visible global function definition for
     ‘conf_mat’
   plot_twoclass_conf_mat: no visible binding for global variable ‘Class’
   plot_twoclass_conf_mat: no visible binding for global variable
     ‘.pred_class’
   plot_twoclass_conf_mat: no visible global function definition for
     ‘autoplot’
   plot_twoclass_obs_pred: no visible global function definition for
     ‘augment’
   plot_twoclass_obs_pred: no visible global function definition for
     ‘ggplot’
   plot_twoclass_obs_pred: no visible global function definition for ‘aes’
   plot_twoclass_obs_pred: no visible global function definition for
     ‘geom_histogram’
   plot_twoclass_obs_pred: no visible global function definition for
     ‘facet_wrap’
   plot_twoclass_obs_pred: no visible global function definition for
     ‘labeller’
   plot_twoclass_obs_pred: no visible binding for global variable
     ‘label_both’
   plot_twoclass_obs_pred: no visible global function definition for
     ‘labs’
   plot_twoclass_obs_pred: no visible global function definition for
     ‘lims’
   plot_twoclass_pr: no visible global function definition for ‘augment’
   plot_twoclass_pr: no visible global function definition for ‘pr_curve’
   plot_twoclass_pr: no visible binding for global variable ‘Class’
   plot_twoclass_pr: no visible global function definition for ‘mutate’
   plot_twoclass_pr: no visible binding for global variable ‘.threshold’
   plot_twoclass_pr: no visible global function definition for ‘arrange’
   plot_twoclass_pr: no visible binding for global variable ‘delta’
   plot_twoclass_pr: no visible global function definition for ‘slice’
   plot_twoclass_pr: no visible global function definition for ‘autoplot’
   plot_twoclass_pr: no visible global function definition for
     ‘geom_point’
   plot_twoclass_pr: no visible global function definition for ‘aes’
   plot_twoclass_pr: no visible binding for global variable ‘specificity’
   plot_twoclass_pr: no visible binding for global variable ‘sensitivity’
   plot_twoclass_pred_factorcol: no visible global function definition for
     ‘mutate’
   plot_twoclass_pred_factorcol: no visible global function definition for
     ‘:=’
   plot_twoclass_pred_factorcol: no visible global function definition for
     ‘case_when’
   plot_twoclass_pred_factorcol: no visible global function definition for
     ‘ggplot’
   plot_twoclass_pred_factorcol: no visible global function definition for
     ‘aes’
   plot_twoclass_pred_factorcol: no visible global function definition for
     ‘sym’
   plot_twoclass_pred_factorcol: no visible global function definition for
     ‘geom_point’
   plot_twoclass_pred_factorcol: no visible binding for global variable
     ‘.color’
   plot_twoclass_pred_factorcol: no visible global function definition for
     ‘facet_wrap’
   plot_twoclass_pred_factorcol: no visible global function definition for
     ‘labeller’
   plot_twoclass_pred_factorcol: no visible binding for global variable
     ‘label_both’
   plot_twoclass_pred_factorcol: no visible global function definition for
     ‘scale_color_identity’
   plot_twoclass_pred_factorcol: no visible global function definition for
     ‘labs’
   plot_twoclass_pred_factorcol: no visible global function definition for
     ‘theme_bw’
   plot_twoclass_pred_factorcol: no visible global function definition for
     ‘theme’
   plot_twoclass_pred_factorcol: no visible global function definition for
     ‘ggplotly’
   plot_twoclass_pred_numcol: no visible global function definition for
     ‘mutate’
   plot_twoclass_pred_numcol: no visible global function definition for
     ‘:=’
   plot_twoclass_pred_numcol: no visible global function definition for
     ‘case_when’
   plot_twoclass_pred_numcol: no visible global function definition for
     ‘ggplot’
   plot_twoclass_pred_numcol: no visible global function definition for
     ‘aes’
   plot_twoclass_pred_numcol: no visible global function definition for
     ‘sym’
   plot_twoclass_pred_numcol: no visible global function definition for
     ‘geom_point’
   plot_twoclass_pred_numcol: no visible binding for global variable
     ‘.color’
   plot_twoclass_pred_numcol: no visible global function definition for
     ‘facet_wrap’
   plot_twoclass_pred_numcol: no visible global function definition for
     ‘labeller’
   plot_twoclass_pred_numcol: no visible binding for global variable
     ‘label_both’
   plot_twoclass_pred_numcol: no visible global function definition for
     ‘scale_color_identity’
   plot_twoclass_pred_numcol: no visible global function definition for
     ‘labs’
   plot_twoclass_pred_numcol: no visible global function definition for
     ‘theme_bw’
   plot_twoclass_pred_numcol: no visible global function definition for
     ‘theme’
   plot_twoclass_pred_numcol: no visible global function definition for
     ‘ggplotly’
   plot_twoclass_roc: no visible global function definition for ‘augment’
   plot_twoclass_roc: no visible global function definition for
     ‘roc_curve’
   plot_twoclass_roc: no visible binding for global variable ‘Class’
   plot_twoclass_roc: no visible global function definition for ‘mutate’
   plot_twoclass_roc: no visible binding for global variable ‘.threshold’
   plot_twoclass_roc: no visible global function definition for ‘arrange’
   plot_twoclass_roc: no visible binding for global variable ‘delta’
   plot_twoclass_roc: no visible global function definition for ‘slice’
   plot_twoclass_roc: no visible global function definition for ‘autoplot’
   plot_twoclass_roc: no visible global function definition for
     ‘geom_point’
   plot_twoclass_roc: no visible global function definition for ‘aes’
   plot_twoclass_roc: no visible binding for global variable ‘specificity’
   plot_twoclass_roc: no visible binding for global variable ‘sensitivity’
   Undefined global functions or variables:
     .color .get_tune_outcome_names .pred .pred_class .residual .threshold
     := Class add_rowindex aes arrange augment autoplot case_when
     collect_predictions conf_mat coord_obs_pred delta facet_wrap
     geom_abline geom_histogram geom_point ggplot ggplotly inner_join
     label_both labeller labs lims mutate pr_curve reorder roc_curve
     scale_color_identity select sensitivity slice specificity sym theme
     theme_bw
   Consider adding
     importFrom("stats", "reorder")
   to your NAMESPACE file.
✓  checking Rd files ...
✓  checking Rd metadata ...
✓  checking Rd line widths ...
✓  checking Rd cross-references ...
W  checking for missing documentation entries ...
   Undocumented code objects:
     ‘ad_data_boost_res’ ‘ames_rf_res’ ‘mtcars_spline_res’ ‘volcano_res’
   Undocumented data sets:
     ‘volcano_res’ ‘ames_rf_res’ ‘mtcars_spline_res’ ‘ad_data_boost_res’
   All user-level objects in a package should have documentation entries.
   See chapter ‘Writing R documentation files’ in the ‘Writing R
   Extensions’ manual.
✓  checking for code/documentation mismatches (899ms)
W  checking Rd \usage sections ...
   Undocumented arguments in documentation object 'plot_numeric_res_factorcol'
     ‘dat’ ‘y_name’
   
   Undocumented arguments in documentation object 'plot_numeric_res_numcol'
     ‘dat’ ‘y_name’
   
   Undocumented arguments in documentation object 'plot_numeric_res_pred'
     ‘dat’ ‘y_name’
   
   Undocumented arguments in documentation object 'plot_twoclass_obs_pred'
     ‘event_level’ ‘prob_bins’
   
   Undocumented arguments in documentation object 'plot_twoclass_pr'
     ‘event_level’
   
   Undocumented arguments in documentation object 'plot_twoclass_pred_factorcol'
     ‘event_level’ ‘prob_breaks’ ‘prob_eps’
   
   Undocumented arguments in documentation object 'plot_twoclass_pred_numcol'
     ‘event_level’ ‘prob_breaks’ ‘prob_eps’
   
   Undocumented arguments in documentation object 'plot_twoclass_roc'
     ‘event_level’
   
   Functions with \usage entries need to have the appropriate \alias
   entries, and all their arguments documented.
   The \usage entries must correspond to syntactically valid R code.
   See chapter ‘Writing R documentation files’ in the ‘Writing R
   Extensions’ manual.
✓  checking Rd contents (1s)
✓  checking for unstated dependencies in examples ...
✓  checking contents of ‘data’ directory (1s)
✓  checking data for non-ASCII characters (1.3s)
W  checking LazyData
     LazyData DB of 6.5 MB without LazyDataCompression set
     See §1.1.6 of 'Writing R Extensions'
✓  checking data for ASCII and uncompressed saves ...
W  checking files in ‘vignettes’
   Files in the 'vignettes' directory but no files in 'inst/doc':
     ‘introduction.Rmd’
   Package has no Sweave vignette sources and no VignetteBuilder field.
─  checking examples ... NONE
✓  checking for unstated dependencies in ‘tests’ ...
─  checking tests ...
✓  Running ‘spelling.R’
X  Comparing ‘spelling.Rout’ to ‘spelling.Rout.save’ ...
   6,27d5
   < Potential spelling errors:
   <   WORD        FOUND IN
   < ORCID       shinymodels-package.Rd:16,17
   < factorcol   plot_numeric_res_factorcol.Rd:13
   <             plot_twoclass_pred_factorcol.Rd:26
   < magrittr    pipe.Rd:10,12
   < numcol      plot_numeric_res_numcol.Rd:13
   <             plot_twoclass_pred_numcol.Rd:26
   < pred        plot_numeric_obs_pred.Rd:16
   <             plot_numeric_res_pred.Rd:10
   <             plot_twoclass_conf_mat.Rd:13
   <             plot_twoclass_obs_pred.Rd:14
   <             plot_twoclass_pred_factorcol.Rd:26
   <             plot_twoclass_pred_numcol.Rd:26
   < roc         plot_twoclass_roc.Rd:5,13,16
   < tidymodel   plot_twoclass_pred_numcol.Rd:29
   < twoclass    plot_twoclass_conf_mat.Rd:13
   <             plot_twoclass_obs_pred.Rd:14
   <             plot_twoclass_pr.Rd:13
   <             plot_twoclass_pred_factorcol.Rd:26
   <             plot_twoclass_pred_numcol.Rd:26
   <             plot_twoclass_roc.Rd:13
E  Running ‘testthat.R’ (4.3s)
   Running the tests in ‘tests/testthat.R’ failed.
   Last 13 lines of output:
     Backtrace:
         ▆
      1. ├─testthat::expect_error(organize_data(lin_mod, mtcars), "res_object should be a fit_resamples() object") test-organize_data.R:32:2
      2. │ └─testthat:::expect_condition_matching(...)
      3. │   └─testthat:::quasi_capture(...)
      4. │     ├─testthat:::.capture(...)
      5. │     │ └─base::withCallingHandlers(...)
      6. │     └─rlang::eval_bare(quo_get_expr(.quo), quo_get_env(.quo))
      7. └─shinymodels::organize_data(lin_mod, mtcars)
      8.   ├─tune::collect_predictions(res_object, summarize = TRUE)
      9.   └─tune:::collect_predictions.default(res_object, summarize = TRUE) /Users/max/github/tune/R/collect.R:87:2
     
     [ FAIL 3 | WARN 2 | SKIP 0 | PASS 3 ]
     Error: Test failures
     Execution halted
✓  checking for non-standard things in the check directory
✓  checking for detritus in the temp directory
   
   See
     ‘/Users/max/github/shinymodels.Rcheck/00check.log’
   for details.
   
── R CMD check results ───────────────────────────── shinymodels 0.0.0.9000 ────
Duration: 25.1s

> checking tests ...
  See below...

> checking dependencies in R code ... WARNING
  '::' or ':::' imports not declared from:
    ‘plotly’ ‘rlang’

> checking for missing documentation entries ... WARNING
  Undocumented code objects:
    ‘ad_data_boost_res’ ‘ames_rf_res’ ‘mtcars_spline_res’ ‘volcano_res’
  Undocumented data sets:
    ‘volcano_res’ ‘ames_rf_res’ ‘mtcars_spline_res’ ‘ad_data_boost_res’
  All user-level objects in a package should have documentation entries.
  See chapter ‘Writing R documentation files’ in the ‘Writing R
  Extensions’ manual.

> checking Rd \usage sections ... WARNING
  Undocumented arguments in documentation object 'plot_numeric_res_factorcol'
    ‘dat’ ‘y_name’
  
  Undocumented arguments in documentation object 'plot_numeric_res_numcol'
    ‘dat’ ‘y_name’
  
  Undocumented arguments in documentation object 'plot_numeric_res_pred'
    ‘dat’ ‘y_name’
  
  Undocumented arguments in documentation object 'plot_twoclass_obs_pred'
    ‘event_level’ ‘prob_bins’
  
  Undocumented arguments in documentation object 'plot_twoclass_pr'
    ‘event_level’
  
  Undocumented arguments in documentation object 'plot_twoclass_pred_factorcol'
    ‘event_level’ ‘prob_breaks’ ‘prob_eps’
  
  Undocumented arguments in documentation object 'plot_twoclass_pred_numcol'
    ‘event_level’ ‘prob_breaks’ ‘prob_eps’
  
  Undocumented arguments in documentation object 'plot_twoclass_roc'
    ‘event_level’
  
  Functions with \usage entries need to have the appropriate \alias
  entries, and all their arguments documented.
  The \usage entries must correspond to syntactically valid R code.
  See chapter ‘Writing R documentation files’ in the ‘Writing R
  Extensions’ manual.

> checking LazyData ... WARNING
    LazyData DB of 6.5 MB without LazyDataCompression set
    See §1.1.6 of 'Writing R Extensions'

> checking files in ‘vignettes’ ... WARNING
  Files in the 'vignettes' directory but no files in 'inst/doc':
    ‘introduction.Rmd’
  Package has no Sweave vignette sources and no VignetteBuilder field.

> checking installed package size ... NOTE
    installed size is  6.6Mb
    sub-directories of 1Mb or more:
      data   6.5Mb

> checking DESCRIPTION meta-information ... NOTE
  Malformed Description field: should contain one or more complete sentences.

> checking R code for possible problems ... NOTE
  first_class_prob_name: no visible global function definition for ‘sym’
  organize_data: no visible global function definition for
    ‘.get_tune_outcome_names’
  organize_data: no visible global function definition for
    ‘collect_predictions’
  organize_data: no visible global function definition for ‘mutate’
  organize_data: no visible global function definition for ‘sym’
  organize_data: no visible binding for global variable ‘.pred’
  organize_data: no visible global function definition for ‘inner_join’
  organize_data: no visible global function definition for ‘add_rowindex’
  organize_data: no visible global function definition for ‘select’
  plot_numeric_obs_pred: no visible global function definition for
    ‘ggplot’
  plot_numeric_obs_pred: no visible global function definition for ‘aes’
  plot_numeric_obs_pred: no visible global function definition for ‘sym’
  plot_numeric_obs_pred: no visible binding for global variable ‘.pred’
  plot_numeric_obs_pred: no visible global function definition for
    ‘geom_abline’
  plot_numeric_obs_pred: no visible global function definition for
    ‘geom_point’
  plot_numeric_obs_pred: no visible binding for global variable ‘.color’
  plot_numeric_obs_pred: no visible global function definition for
    ‘scale_color_identity’
  plot_numeric_obs_pred: no visible global function definition for
    ‘coord_obs_pred’
  plot_numeric_obs_pred: no visible global function definition for ‘labs’
  plot_numeric_obs_pred: no visible global function definition for
    ‘theme_bw’
  plot_numeric_obs_pred: no visible global function definition for
    ‘theme’
  plot_numeric_obs_pred: no visible global function definition for
    ‘ggplotly’
  plot_numeric_res_factorcol: no visible global function definition for
    ‘ggplot’
  plot_numeric_res_factorcol: no visible global function definition for
    ‘aes’
  plot_numeric_res_factorcol: no visible global function definition for
    ‘reorder’
  plot_numeric_res_factorcol: no visible global function definition for
    ‘sym’
  plot_numeric_res_factorcol: no visible binding for global variable
    ‘.residual’
  plot_numeric_res_factorcol: no visible global function definition for
    ‘geom_point’
  plot_numeric_res_factorcol: no visible global function definition for
    ‘geom_abline’
  plot_numeric_res_factorcol: no visible binding for global variable
    ‘.color’
  plot_numeric_res_factorcol: no visible global function definition for
    ‘scale_color_identity’
  plot_numeric_res_factorcol: no visible global function definition for
    ‘coord_obs_pred’
  plot_numeric_res_factorcol: no visible global function definition for
    ‘labs’
  plot_numeric_res_factorcol: no visible global function definition for
    ‘theme_bw’
  plot_numeric_res_factorcol: no visible global function definition for
    ‘theme’
  plot_numeric_res_factorcol: no visible global function definition for
    ‘ggplotly’
  plot_numeric_res_numcol: no visible global function definition for
    ‘ggplot’
  plot_numeric_res_numcol: no visible global function definition for
    ‘aes’
  plot_numeric_res_numcol: no visible global function definition for
    ‘sym’
  plot_numeric_res_numcol: no visible binding for global variable
    ‘.residual’
  plot_numeric_res_numcol: no visible global function definition for
    ‘geom_abline’
  plot_numeric_res_numcol: no visible global function definition for
    ‘geom_point’
  plot_numeric_res_numcol: no visible binding for global variable
    ‘.color’
  plot_numeric_res_numcol: no visible global function definition for
    ‘scale_color_identity’
  plot_numeric_res_numcol: no visible global function definition for
    ‘coord_obs_pred’
  plot_numeric_res_numcol: no visible global function definition for
    ‘labs’
  plot_numeric_res_numcol: no visible global function definition for
    ‘theme_bw’
  plot_numeric_res_numcol: no visible global function definition for
    ‘theme’
  plot_numeric_res_numcol: no visible global function definition for
    ‘ggplotly’
  plot_numeric_res_pred: no visible global function definition for
    ‘ggplot’
  plot_numeric_res_pred: no visible global function definition for ‘aes’
  plot_numeric_res_pred: no visible global function definition for ‘sym’
  plot_numeric_res_pred: no visible binding for global variable
    ‘.residual’
  plot_numeric_res_pred: no visible global function definition for
    ‘geom_abline’
  plot_numeric_res_pred: no visible global function definition for
    ‘geom_point’
  plot_numeric_res_pred: no visible binding for global variable ‘.color’
  plot_numeric_res_pred: no visible global function definition for
    ‘scale_color_identity’
  plot_numeric_res_pred: no visible global function definition for
    ‘coord_obs_pred’
  plot_numeric_res_pred: no visible global function definition for ‘labs’
  plot_numeric_res_pred: no visible global function definition for
    ‘theme_bw’
  plot_numeric_res_pred: no visible global function definition for
    ‘theme’
  plot_numeric_res_pred: no visible global function definition for
    ‘ggplotly’
  plot_twoclass_conf_mat: no visible global function definition for
    ‘augment’
  plot_twoclass_conf_mat: no visible global function definition for
    ‘conf_mat’
  plot_twoclass_conf_mat: no visible binding for global variable ‘Class’
  plot_twoclass_conf_mat: no visible binding for global variable
    ‘.pred_class’
  plot_twoclass_conf_mat: no visible global function definition for
    ‘autoplot’
  plot_twoclass_obs_pred: no visible global function definition for
    ‘augment’
  plot_twoclass_obs_pred: no visible global function definition for
    ‘ggplot’
  plot_twoclass_obs_pred: no visible global function definition for ‘aes’
  plot_twoclass_obs_pred: no visible global function definition for
    ‘geom_histogram’
  plot_twoclass_obs_pred: no visible global function definition for
    ‘facet_wrap’
  plot_twoclass_obs_pred: no visible global function definition for
    ‘labeller’
  plot_twoclass_obs_pred: no visible binding for global variable
    ‘label_both’
  plot_twoclass_obs_pred: no visible global function definition for
    ‘labs’
  plot_twoclass_obs_pred: no visible global function definition for
    ‘lims’
  plot_twoclass_pr: no visible global function definition for ‘augment’
  plot_twoclass_pr: no visible global function definition for ‘pr_curve’
  plot_twoclass_pr: no visible binding for global variable ‘Class’
  plot_twoclass_pr: no visible global function definition for ‘mutate’
  plot_twoclass_pr: no visible binding for global variable ‘.threshold’
  plot_twoclass_pr: no visible global function definition for ‘arrange’
  plot_twoclass_pr: no visible binding for global variable ‘delta’
  plot_twoclass_pr: no visible global function definition for ‘slice’
  plot_twoclass_pr: no visible global function definition for ‘autoplot’
  plot_twoclass_pr: no visible global function definition for
    ‘geom_point’
  plot_twoclass_pr: no visible global function definition for ‘aes’
  plot_twoclass_pr: no visible binding for global variable ‘specificity’
  plot_twoclass_pr: no visible binding for global variable ‘sensitivity’
  plot_twoclass_pred_factorcol: no visible global function definition for
    ‘mutate’
  plot_twoclass_pred_factorcol: no visible global function definition for
    ‘:=’
  plot_twoclass_pred_factorcol: no visible global function definition for
    ‘case_when’
  plot_twoclass_pred_factorcol: no visible global function definition for
    ‘ggplot’
  plot_twoclass_pred_factorcol: no visible global function definition for
    ‘aes’
  plot_twoclass_pred_factorcol: no visible global function definition for
    ‘sym’
  plot_twoclass_pred_factorcol: no visible global function definition for
    ‘geom_point’
  plot_twoclass_pred_factorcol: no visible binding for global variable
    ‘.color’
  plot_twoclass_pred_factorcol: no visible global function definition for
    ‘facet_wrap’
  plot_twoclass_pred_factorcol: no visible global function definition for
    ‘labeller’
  plot_twoclass_pred_factorcol: no visible binding for global variable
    ‘label_both’
  plot_twoclass_pred_factorcol: no visible global function definition for
    ‘scale_color_identity’
  plot_twoclass_pred_factorcol: no visible global function definition for
    ‘labs’
  plot_twoclass_pred_factorcol: no visible global function definition for
    ‘theme_bw’
  plot_twoclass_pred_factorcol: no visible global function definition for
    ‘theme’
  plot_twoclass_pred_factorcol: no visible global function definition for
    ‘ggplotly’
  plot_twoclass_pred_numcol: no visible global function definition for
    ‘mutate’
  plot_twoclass_pred_numcol: no visible global function definition for
    ‘:=’
  plot_twoclass_pred_numcol: no visible global function definition for
    ‘case_when’
  plot_twoclass_pred_numcol: no visible global function definition for
    ‘ggplot’
  plot_twoclass_pred_numcol: no visible global function definition for
    ‘aes’
  plot_twoclass_pred_numcol: no visible global function definition for
    ‘sym’
  plot_twoclass_pred_numcol: no visible global function definition for
    ‘geom_point’
  plot_twoclass_pred_numcol: no visible binding for global variable
    ‘.color’
  plot_twoclass_pred_numcol: no visible global function definition for
    ‘facet_wrap’
  plot_twoclass_pred_numcol: no visible global function definition for
    ‘labeller’
  plot_twoclass_pred_numcol: no visible binding for global variable
    ‘label_both’
  plot_twoclass_pred_numcol: no visible global function definition for
    ‘scale_color_identity’
  plot_twoclass_pred_numcol: no visible global function definition for
    ‘labs’
  plot_twoclass_pred_numcol: no visible global function definition for
    ‘theme_bw’
  plot_twoclass_pred_numcol: no visible global function definition for
    ‘theme’
  plot_twoclass_pred_numcol: no visible global function definition for
    ‘ggplotly’
  plot_twoclass_roc: no visible global function definition for ‘augment’
  plot_twoclass_roc: no visible global function definition for
    ‘roc_curve’
  plot_twoclass_roc: no visible binding for global variable ‘Class’
  plot_twoclass_roc: no visible global function definition for ‘mutate’
  plot_twoclass_roc: no visible binding for global variable ‘.threshold’
  plot_twoclass_roc: no visible global function definition for ‘arrange’
  plot_twoclass_roc: no visible binding for global variable ‘delta’
  plot_twoclass_roc: no visible global function definition for ‘slice’
  plot_twoclass_roc: no visible global function definition for ‘autoplot’
  plot_twoclass_roc: no visible global function definition for
    ‘geom_point’
  plot_twoclass_roc: no visible global function definition for ‘aes’
  plot_twoclass_roc: no visible binding for global variable ‘specificity’
  plot_twoclass_roc: no visible binding for global variable ‘sensitivity’
  Undefined global functions or variables:
    .color .get_tune_outcome_names .pred .pred_class .residual .threshold
    := Class add_rowindex aes arrange augment autoplot case_when
    collect_predictions conf_mat coord_obs_pred delta facet_wrap
    geom_abline geom_histogram geom_point ggplot ggplotly inner_join
    label_both labeller labs lims mutate pr_curve reorder roc_curve
    scale_color_identity select sensitivity slice specificity sym theme
    theme_bw
  Consider adding
    importFrom("stats", "reorder")
  to your NAMESPACE file.

── Test failures ───────────────────────────────────────────────── testthat ────

> library(testthat)
Warning message:
Can't find generic `testthat_print` in package testthat to register S3 method.
i This message is only shown to developers using devtools.
i Do you need to update testthat to the latest version? 
> library(shinymodels)
> 
> test_check("shinymodels")
── Attaching packages ────────────────────────────────────── tidymodels 0.1.3 ──
✓ broom        0.7.8          ✓ recipes      0.1.16    
✓ dials        0.0.9.9000     ✓ rsample      0.1.0     
✓ dplyr        1.0.7          ✓ tibble       3.1.2     
✓ ggplot2      3.3.4          ✓ tidyr        1.1.3     
✓ infer        0.5.4          ✓ tune         0.1.5.9001
✓ modeldata    0.1.0          ✓ workflows    0.2.2.9000
✓ parsnip      0.1.6.9000     ✓ workflowsets 0.0.2.9000
✓ purrr        0.3.4          ✓ yardstick    0.0.8     
── Conflicts ───────────────────────────────────────── tidymodels_conflicts() ──
x purrr::discard() masks scales::discard()
x dplyr::filter()  masks stats::filter()
x purrr::is_null() masks testthat::is_null()
x dplyr::lag()     masks stats::lag()
x tidyr::matches() masks rsample::matches(), dplyr::matches(), testthat::matches()
x recipes::step()  masks stats::step()
• Use tidymodels_prefer() to resolve common conflicts.
══ Warnings ════════════════════════════════════════════════════════════════════
── Warning (test-first_level.R:5:1): (code run outside of `test_that()`) ───────
data set 'ad_data' not found
Backtrace:
 1. utils::data(ad_data) test-first_level.R:5:0
── Warning (test-first_level_prob_name.R:5:1): (code run outside of `test_that()`) ──
data set 'ad_data' not found
Backtrace:
 1. utils::data(ad_data) test-first_level_prob_name.R:5:0

══ Failed tests ════════════════════════════════════════════════════════════════
── Error (test-first_level.R:7:1): (code run outside of `test_that()`) ─────────
Error: could not find function ".get_tune_outcome_names"
Backtrace:
    ▆
 1. └─shinymodels::organize_data(ad_data_boost_res, ad_data) test-first_level.R:7:0
── Error (test-first_level_prob_name.R:7:1): (code run outside of `test_that()`) ──
Error: could not find function ".get_tune_outcome_names"
Backtrace:
    ▆
 1. └─shinymodels::organize_data(ad_data_boost_res, ad_data) test-first_level_prob_name.R:7:0
── Error (test-organize_data.R:32:3): can accurately organize data ─────────────
Error: No `collect_predictions()` exists for this type of object.
Backtrace:
    ▆
 1. ├─testthat::expect_error(organize_data(lin_mod, mtcars), "res_object should be a fit_resamples() object") test-organize_data.R:32:2
 2. │ └─testthat:::expect_condition_matching(...)
 3. │   └─testthat:::quasi_capture(...)
 4. │     ├─testthat:::.capture(...)
 5. │     │ └─base::withCallingHandlers(...)
 6. │     └─rlang::eval_bare(quo_get_expr(.quo), quo_get_env(.quo))
 7. └─shinymodels::organize_data(lin_mod, mtcars)
 8.   ├─tune::collect_predictions(res_object, summarize = TRUE)
 9.   └─tune:::collect_predictions.default(res_object, summarize = TRUE) /Users/max/github/tune/R/collect.R:87:2

[ FAIL 3 | WARN 2 | SKIP 0 | PASS 3 ]
Error: Test failures
Execution halted

1 error x | 5 warnings x | 3 notes x
Error: R CMD check found ERRORs

Execution halted

Exited with status 1.

R/Misc.R Outdated Show resolved Hide resolved
R/Misc.R Outdated Show resolved Hide resolved
R/Misc.R Show resolved Hide resolved
R/Misc.R Outdated Show resolved Hide resolved
R/Misc.R Outdated Show resolved Hide resolved
R/regression_diag_plots.R Outdated Show resolved Hide resolved
R/regression_diag_plots.R Outdated Show resolved Hide resolved
tests/testthat/test-first_level.R Outdated Show resolved Hide resolved
tests/testthat/test-first_level.R Outdated Show resolved Hide resolved
tests/testthat/test-organize_data.R Outdated Show resolved Hide resolved
adhikars11 and others added 10 commits June 28, 2021 07:44
Co-authored-by: Max Kuhn <mxkuhn@gmail.com>
Co-authored-by: Max Kuhn <mxkuhn@gmail.com>
Co-authored-by: Max Kuhn <mxkuhn@gmail.com>
Co-authored-by: Max Kuhn <mxkuhn@gmail.com>
Co-authored-by: Max Kuhn <mxkuhn@gmail.com>
Merge branch 'initial_plot_functions' of https://github.com/adhikars11/shinymodels into initial_plot_functions

# Conflicts:
#	tests/testthat/test-first_level.R
@adhikars11 adhikars11 merged commit bcef19e into main Jun 30, 2021
@adhikars11 adhikars11 deleted the initial_plot_functions branch June 30, 2021 17:41
@github-actions
Copy link

This pull request has been automatically locked. If you believe you have found a related problem, please file a new issue (with a reprex: https://reprex.tidyverse.org) and link to this issue.

@github-actions github-actions bot locked and limited conversation to collaborators Jan 11, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants