div.ProseMirror

Microsoft Open R 4.0.2

With GoogleAnalyticsR, rym, vroom and RPostgres

Setup

Install prereqs.

apt-get -qq update
DEBIAN_FRONTEND=noninteractive apt-get install --no-install-recommends \
  software-properties-common gnupg2
13.3s
MS Open R 4.0.2 (Bash)

Download and install R.

wget -q --show-progress --progress=bar:force -P /results \
https://mran.blob.core.windows.net/install/mro/4.0.2/Ubuntu/microsoft-r-open-4.0.2.tar.gz 
32.2s
MS Open R 4.0.2 (Bash)
microsoft-r-open-4.0.2.tar.gz
219.45 MB
curl -sSL https://packages.microsoft.com/keys/microsoft.asc | sudo apt-key add - 
apt-add-repository https://packages.microsoft.com/ubuntu/18.04/prod 
tar zxvf 
microsoft-r-open-4.0.2.tar.gz
cd microsoft-r-open
ls -lah
./install.sh -a -s -u
22.9s
MS Open R 4.0.2 (Bash)

Upgrade and install system packages.

export DEBIAN_FRONTEND=noninteractive
apt-get -qq update
apt-get upgrade
apt-get install --no-install-recommends gnupg2 \
  libpq-dev unixodbc-dev libxml2-dev libssl-dev libssh2-1 libcurl4-openssl-dev \
  libcairo2-dev libpango1.0-dev libpangocairo-1.0 libv8-dev
apt-get clean
rm -r /var/lib/apt/lists/* /microsoft-r-open # Clear package list so it isn't stale
129.7s
MS Open R 4.0.2 (Bash)

Install CRAN packages.

R -e 'options(repos = c(CRAN = "https://cran.revolutionanalytics.com"))
install.packages(
  c("base64enc", "jsonlite", "devtools", "tidyverse", "foreach", "data.table",
    "googleAuthR", "vroom", "googleAnalyticsR", "rym",
    "RPostgres", "RPostgreSQL", "DBI",
    "janitor", "hms", "forcats", "RcppRoll", "bit64"), 
  Ncpus = 4)'
794.3s
MS Open R 4.0.2 (Bash)

Link old cert location to new location that actually exists, so curl works, so install_github() works.

mkdir -p /opt/microsoft/ropen/4.0.0/lib64/R/lib
ln -sf /opt/microsoft/ropen/4.0.2/lib64/R/lib/microsoft-r-cacert.pem \
  /opt/microsoft/ropen/4.0.0/lib64/R/lib/microsoft-r-cacert.pem
0.5s
MS Open R 4.0.2 (Bash)

Replace R binaries with script redirects that get rid of obnoxious startup message that messes with some installs.

for bin in R Rscript; do
  rpath="$(readlink -f /usr/bin/${bin})"
  if [ ! -L "$rpath" ]; then
    mv $rpath $rpath.bin
    echo "#!/bin/bash" > $rpath.sh
    echo "${rpath}.bin --silent" '"$@"' >> $rpath.sh
    chmod +x $rpath.sh
    ln -sf $rpath.sh $rpath
  fi
done
0.6s
MS Open R 4.0.2 (Bash)

Install exploratory-io/exploratory_func—note dependency anonymizer has been removed from CRAN, so we have to get that from github first.

R -q -e 'options(repos = c(CRAN = "https://cran.revolutionanalytics.com"))
devtools::install_github("paulhendricks/anonymizer@0.2.2",
  build_opts = c("--no-manual", "--no-build-vignettes"))
devtools::install_github("exploratory-io/exploratory_func",
  build_opts = c("--no-manual", "--no-build-vignettes"))'    
1010.8s
MS Open R 4.0.2 (Bash)

Make sure all packages are updated.

R -e 'options(repos = c(CRAN = "https://cran.revolutionanalytics.com"))
update.packages(ask = FALSE)'
30.1s
MS Open R 4.0.2 (Bash)

Check.

R -e 'Revo.version'
du -hsx /
5.3s
MS Open R 4.0.2 (Bash)

Test

Revo.version
0.4s
Test (R)
MS Open R 4.0.2
print("Hello, world!")
0.4s
Test (R)
MS Open R 4.0.2
Runtimes (2)