zachmayer / caretEnsemble

caret models all the way down :turtle:
Other
226 stars 75 forks source link

mandatory deps for package check #205

Closed jangorecki closed 8 years ago

jangorecki commented 8 years ago

any chance for a list of packages that are mandatory to run package check? I see the (impressive) list in travis yaml has all possible dependencies, but I would like to install as few as necessary to run R CMD check.

zachmayer commented 8 years ago

If you set the NOT_CRAN environment variable to "false", it should run with the bare packages listed in the description file

jangorecki commented 8 years ago

It doesn't seems to help.

echo $NOT_CRAN
#false
R CMD check --no-manual --ignore-vignettes caretEnsemble_2.0.0.tar.gz 
* checking package dependencies ... NOTE
Packages suggested but not available for checking:
  ‘caTools’ ‘lintr’ ‘glmnet’ ‘e1071’ ‘pROC’ ‘mlbench’ ‘klaR’
...
* checking tests ...
  Running ‘testthat.R’
 ERROR
Running the tests in ‘tests/testthat.R’ failed.
Last 13 lines of output:
  Calls: test_check ... eval -> suppressMessages -> withCallingHandlers -> library
  testthat results ================================================================
  OK: 301 SKIPPED: 28 FAILED: 7
  1. Error: caretList predictions (@test-caretList.R#98) 
  2. Error: Classification models (@test-caretList.R#276) 
  3. Error: We can stack classification models (@test-caretStack.R#30) 
  4. Error: Failure to calculate se occurs gracefully (@test-caretStack.R#60) 
  5. Error: We can extract resdiuals from caretEnsemble objects (@test-ensemble.R#42) 
  6. Error: We can ensemble regression models (@test-ensemble.R#88) 
  7. Error: It works for classification models (@test-ensemble.R#174) 

  Error: testthat unit tests failed
  Execution halted

I reproduced first fails from https://github.com/zachmayer/caretEnsemble/blob/master/tests/testthat/test-caretList.R#L98 interactively and it looks like some of suggested deps are required.

expect_warning({
    models <- caretList(
      iris[, 1:2], iris[, 5],
      tuneLength=1, verbose=FALSE,
      methodList="rf", tuneList=list(nnet=caretModelSpec(method="nnet", trace=FALSE)),
      trControl=trainControl(
        method="cv",
        number=2, savePredictions="final",
        classProbs=FALSE)
      )
  })
#Error in requireNamespaceQuietStop("e1071") : package e1071 is required
zachmayer commented 8 years ago

Hmm I'll have to check the correct way to run tests as cran

Sent from my iPhone

On May 16, 2016, at 6:26 PM, Jan Gorecki notifications@github.com wrote:

It doesn't seems to help.

echo $NOT_CRAN

false

R CMD check --no-manual --ignore-vignettes caretEnsemble_2.0.0.tar.gz

  • checking package dependencies ... NOTE Packages suggested but not available for checking: ‘caTools’ ‘lintr’ ‘glmnet’ ‘e1071’ ‘pROC’ ‘mlbench’ ‘klaR’ ...
  • checking tests ... Running ‘testthat.R’ ERROR Running the tests in ‘tests/testthat.R’ failed. Last 13 lines of output: Calls: test_check ... eval -> suppressMessages -> withCallingHandlers -> library testthat results ================================================================ OK: 301 SKIPPED: 28 FAILED: 7

    1. Error: caretList predictions (@test-caretList.R#98)
    2. Error: Classification models (@test-caretList.R#276)
    3. Error: We can stack classification models (@test-caretStack.R#30)
    4. Error: Failure to calculate se occurs gracefully (@test-caretStack.R#60)
    5. Error: We can extract resdiuals from caretEnsemble objects (@test-ensemble.R#42)
    6. Error: We can ensemble regression models (@test-ensemble.R#88)
    7. Error: It works for classification models (@test-ensemble.R#174)

    Error: testthat unit tests failed Execution halted I reproduced first fails from https://github.com/zachmayer/caretEnsemble/blob/master/tests/testthat/test-caretList.R#L98 interactively and it looks like some of suggested deps are required.

expect_warning({ models <- caretList( iris[, 1:2], iris[, 5], tuneLength=1, verbose=FALSE, methodList="rf", tuneList=list(nnet=caretModelSpec(method="nnet", trace=FALSE)), trControl=trainControl( method="cv", number=2, savePredictions="final", classProbs=FALSE) ) })

Error in requireNamespaceQuietStop("e1071") : package e1071 is required

— You are receiving this because you commented. Reply to this email directly or view it on GitHub

jangorecki commented 8 years ago

Besides checking that it may be worth to have a list of really mandatory packages on hand.

zachmayer commented 8 years ago

It should be the list that's installed in Travis-- if it's not I should prune down the list in travis.

Sent from my iPhone

On May 16, 2016, at 6:49 PM, Jan Gorecki notifications@github.com wrote:

Besides checking that it may be worth to have a list of really mandatory package on hand.

— You are receiving this because you commented. Reply to this email directly or view it on GitHub

jangorecki commented 8 years ago

You mean that all of suggested deps are required to pass the check? as the list in travis probably lists all deps, not necessarily all required for check.

zachmayer commented 8 years ago

Pretty sure they're all required for a full check, as not cran

zachmayer commented 8 years ago

I'll go through the travis file sometime, and make sure there's nothing there that isn't required for the unit tests or the vignettes. I'm pretty sure that's already the minimal requirements, but will check when I have time.

In the meantime, you can try to setup your environment variables to skip tests marked skip_on_cran(), which will let your run R CMD CHECK with just the dependencies in the DESCRIPTION file.

jangorecki commented 8 years ago

FYI: at least caTools and lintr suggested dependencies were not required to pass check with --as-cran.

zachmayer commented 8 years ago

Good to know— I will remove those from the travis file. Thank you!

jangorecki commented 7 years ago

@zachmayer To do not open new issue as this is still related to dependencies management. rmarkdown pkg is missing in suggested deps, when you try to build pkg without rmarkdown, just with knitr, it will end up with error.

$ R CMD build --no-manual .
* checking for file ‘./DESCRIPTION’ ... OK
* preparing ‘caretEnsemble’:
* checking DESCRIPTION meta-information ... OK
* installing the package to build vignettes
* creating vignettes ... ERROR
Warning in engine$weave(file, quiet = quiet, encoding = enc) :
  The vignette engine knitr::rmarkdown is not available, because the rmarkdown package is not installed. Please install it.
Error: processing vignette 'caretEnsemble-intro.Rmd' failed with diagnostics:
It seems you should call rmarkdown::render() instead of knitr::knit2html() because caretEnsemble-intro.Rmd appears to be an R Markdown v2 document.
Execution halted
zachmayer commented 7 years ago

@jangorecki PR to fix this here: https://github.com/zachmayer/caretEnsemble/pull/214

In the future, for small changes like this, please feel free to open the PR yourself.