rocker-org / binder

Template for RStudio on Binder / JupyterHub
GNU General Public License v2.0
69 stars 32 forks source link

caret and rsample packages #38

Closed flor14 closed 4 years ago

flor14 commented 5 years ago

Hello!

I am creating an environment for R with a Dockerfile like this one:

FROM rocker/binder:3.5.2

ARG NB_USER
ARG NB_UID

USER root
COPY . ${HOME}

RUN chown -R ${NB_USER} ${HOME}

USER ${NB_USER}

RUN if [ -f install.R ]; then R --quiet -f install.R; fi

Also, I have installed this packages with an install.R file:

install.packages("tidyverse")
install.packages("rsample")
install.packages("yardstick")
install.packages("randomForest")  
install.packages("caret")   
install.packages("rjson")  
install.packages("gbm")
install.packages("xgboost")
install.packages("e1071")

runtime.txt r-2019-08-10

The packages seem to work fine, with the exception of rsamples and caret package. Both packages are not found when I run the code.

I tried several things to solve this but all without success. I suspect it is a problem with dependencies or package versions.

Have you any idea on why this happens and how to solve it?

cboettig commented 5 years ago

Your install.R file worked just fine with the rocker/binder:3.5.2-based Dockerfile shown above for me. Can you let us know what error you see?

Unrelated but please note that 3.5.2 is pinned to MRAN date of 2019-03-11 https://github.com/rocker-org/rocker-versioned/blob/master/VERSIONS.md; that's not that different than what you have here but note versions are automatically pinned for reproducibility to the R version, your runtime.txt doesn't override that in this Dockerfile.

flor14 commented 5 years ago

Thank you for the answer and explanation about runtime.txt

This is the error:

Error in library(caret): there is no package called ‘caret’
Traceback:

1. library(caret)
2. stop(txt, domain = NA)

Another probably useful information are the package versions (I did not use this code, it is just for the packages versions):

install_version("e1071", "1.6-8")
install_version("gbm", "2.1.3")
install_version("randomForest", "4.6-12")
install_version("xgboost", "0.6.4.1")
install_version("caret", "6.0-78")
install_version("yardstick", "0.0.1")
install_version("tidyverse", "1.2.1")

caret version is not new, not sure if this could be part of the problem: caret_6.0-78 date 2017-12-10 (https://cran.r-project.org/src/contrib/Archive/caret/)

cboettig commented 5 years ago

Versions are handled automatically by fixing the R version, which fixes the MRAN date. Please check the rest of your error log to see what cran repo the installer is using? I cannot reproduce this error

On Mon, Sep 16, 2019 at 2:14 PM flor14 notifications@github.com wrote:

Thank you for the answer and explanation about runtime.txt

This is the error:

Error in library(caret): there is no package called ‘caret’

Traceback:

  1. library(caret)

  2. stop(txt, domain = NA)

Another probably useful information are the package versions (I did not use this code, it is just for the packages versions):

install_version("e1071", "1.6-8")

install_version("gbm", "2.1.3")

install_version("randomForest", "4.6-12")

install_version("xgboost", "0.6.4.1")

install_version("caret", "6.0-78")

install_version("yardstick", "0.0.1")

install_version("tidyverse", "1.2.1")

caret version is not new, not sure if this could be part of the problem: caret_6.0-78 date 2017-12-10 ( https://cran.r-project.org/src/contrib/Archive/caret/)

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/rocker-org/binder/issues/38?email_source=notifications&email_token=AABWK6VX56OQRSPNNFAGBGDQJ7ZKHA5CNFSM4IXBTD2KYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD62RIOA#issuecomment-531960888, or mute the thread https://github.com/notifications/unsubscribe-auth/AABWK6VI3IHNLYXBOFQPLXTQJ7ZKHANCNFSM4IXBTD2A .

--

Carl Boettiger http://carlboettiger.info/