anchor.diff:  # expose the RStudio IDE port
   EXPOSE 8787 
   
  -# expose the port for the shiny server
  -#EXPOSE 3838
  -
  -RUN echo 'auth-stay-signed-in=0' >> /etc/rstudio/rserver.conf
  -
  -CMD ["/usr/bin/supervisord"]
  +# set the locale so RStudio doesn't complain about UTF-8
  +RUN apt-get install  -y locales 
  +RUN locale-gen en_US en_US.UTF-8
  +RUN DEBIAN_FRONTEND=noninteractive dpkg-reconfigure locales
  +
  +CMD ["/usr/bin/supervisord"]
positive.code: 	
  RUN DEBIAN_FRONTEND=noninteractive R --vanilla --quiet -e 'install.packages( c("pROC", "gtools", "gdata", "gplots", "MLmetrics", "yardstick", "xgboost", "ModelMetrics", "caret", "e1071", "dotCall64", "spam", "fields", "ROCR", "reticulate", "tfruns", "tensorflow", "zeallot", "keras", "coda", "greta" ), repos="http://cran.us.r-project.org",quiet=TRUE)'
  
  
  RUN R CMD BATCH /r-studio/install-2018-packages-1.R
  RUN R CMD BATCH /r-studio/install-2018-packages-2.R
  
negative.code: FROM  ubuntu:20.04
  
  # install R
  RUN apt update
  RUN apt install -y gnupg2 software-properties-common
  
  # RUN add-apt-repository deb https://cloud.r-project.org/bin/linux/ubuntu focal-cran40/
  RUN apt-key adv --keyserver keyserver.ubuntu.com --recv-keys E298A3A825C0D65DFD57CBB651716619E084DAB9
  RUN gpg --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys E298A3A825C0D65DFD57CBB651716619E084DAB9
  RUN gpg -a --export E298A3A825C0D65DFD57CBB651716619E084DAB9 | apt-key add -
  RUN add-apt-repository 'deb https://cloud.r-project.org/bin/linux/ubuntu focal-cran40/'
  RUN apt update
  RUN DEBIAN_FRONTEND=noninteractive apt install -y r-base r-base-core r-recommended r-base-dev
  
  
  # we want OpenBLAS for faster linear algebra as described here: http://brettklamer.com/diversions/statistical/faster-blas-in-r/
  RUN apt-get install  -y \
     apt-utils \
     libopenblas-base
  
  RUN apt-get update ; \
     DEBIAN_FRONTEND=noninteractive apt-get  install -y  \
     vim \
     less \
     net-tools \
     inetutils-ping \
     curl \
     git \
     telnet \
     nmap \
     socat \
     wget \
     sudo \
     libcurl4-openssl-dev \
     libxml2-dev 
  
  # we need TeX for the rmarkdown package in RStudio, and pandoc is also useful 
  RUN apt-get update 
  RUN DEBIAN_FRONTEND=noninteractive apt-get  install -y \
     texlive \
     texlive-base \
     texlive-latex-extra \
     texlive-pstricks \
     texlive-publishers \
     texlive-fonts-extra \
     texlive-humanities \
     lmodern \
     pandoc \
  # dependency for R XML library
    libxml2 \ 
    libxml2-dev \
    libssl-dev 
  
  # R-Studio
  RUN DEBIAN_FRONTEND=noninteractive apt-get install -y gdebi-core
  RUN DEBIAN_FRONTEND=noninteractive wget https://download2.rstudio.org/server/bionic/amd64/rstudio-server-1.3.1056-amd64.deb
  RUN DEBIAN_FRONTEND=noninteractive gdebi --n rstudio-server-1.3.1056-amd64.deb
     
  # install packages via R scripts found in conf directory
  ADD ./conf /r-studio   
  
  
  
  # more OS-level libraries
  RUN apt-get update 
  RUN DEBIAN_FRONTEND=noninteractive apt-get  install -y \
    libfreetype6-dev
  
  RUN /usr/bin/R -e 'options(warn=2); install.packages(c(  \
      "R.cache", \
      "R.methodsS3", \
      "R.rsp", \
      "R.utils" \
      ), repos="http://cran.us.r-project.org")'
  
  RUN /usr/bin/R -e 'options(warn=2); install.packages(c( \
      "timeDate", \
      "tidymodels", \
      "tidypredict", \
      "tidyr", \
      "tidyselect", \
      "tidytext", \
      "tidygraph", \
      "tidyverse" \
      ), repos="http://cran.us.r-project.org")'
  
  RUN /usr/bin/R -e 'options(warn=2); install.packages(c( \
      "statmod", \
      "car", \
      "dbplyr", \
      "dplyr", \
      "dygraphs", \
      "evaluate", \
      "forecast", \
      "formatR" \
      ), repos="http://cran.us.r-project.org")'
  
  
  RUN apt-get update 
  RUN DEBIAN_FRONTEND=noninteractive apt-get  install -y \
      libudunits2-dev
  
  RUN /usr/bin/R -e 'options(warn=2); install.packages(c( \
      "gdata", \
      "ggforce", \
      "ggformula", \
      "ggmap", \
      "ggplot2", \
      "ggraph", \
      "ggrepel", \
      "ggridges", \
      "ggstance"  \
      ),  repos="http://cran.us.r-project.org")'
  
  RUN /usr/bin/R -e 'options(warn=2); install.packages(c(  \
      "gmodels", \
      "gtable", \
      "gtools", \
      "import", \
      "jpeg"  \
      ),  repos="http://cran.us.r-project.org")'
  
  RUN /usr/bin/R -e 'options(warn=2); install.packages(c(  \
      "matrixStats", \
      "modelr", \
      "modeltools", \
      "mosaic", \
      "mosaicData", \
      "mvtnorm"  \
      ),  repos="http://cran.us.r-project.org")'
    
  RUN /usr/bin/R -e 'options(warn=2); install.packages(c(  \
      "nycflights13", \
      "openintro", \
      "plyr", \
      "png", \
      "purrr", \
      "readr", \
      "readxl"  \
      ), repos="http://cran.us.r-project.org")'
    
  RUN DEBIAN_FRONTEND=noninteractive R --vanilla --quiet -e 'install.packages( c("chron", "data.table", "rematch", "cellranger", "tidyr", "googlesheets", "hms", "readr", "selectr", "rvest", "pbkrtest"), repos="http://cran.us.r-project.org",quiet=TRUE)'
  RUN DEBIAN_FRONTEND=noninteractive R --vanilla --quiet -e 'install.packages( c("SparseM", "MatrixModels", "quantreg", "sp", "maptools", "haven", "ellipsis", "forcats", "readxl", "zip", "openxlsx", "rio", "abind", "carData", "car", "mosaicData", "latticeExtra", "gridExtra", "ggdendro", "mnormt", "psych", "generics", "broom", "reshape", "progress", "ggstance", "ggformula", "mosaicCore", "ggrepel", "base64enc", "crosstalk", "htmlwidgets", "png", "raster", "viridis", "leaflet", "mosaic"), repos="http://cran.us.r-project.org",quiet=TRUE)'
  
  # Cliburn Chan requested these:
  RUN  DEBIAN_FRONTEND=noninteractive R --vanilla --quiet -e 'install.packages( c("maps", "zoo", "gcookbook", "corrplot", "grepel", "base64enc", "crosstalk", "htmlwidgets", "png", "raster", "viridis", "leaflet", "mosaic"), repos="http://cran.us.r-project.org",quiet=TRUE)'
     
  
  # Cliburn also wanted these
  # but they have mega-dependencies, so intall them the other way
  