R Shiny at IQSS
  • Introduction
  • Getting started
    • Determining your resource requirements
    • Applying for an account
  • Deploying
    • Setup your environment
    • Deploying an example Shiny app
    • Bootstrapping a new Shiny app or migrating a pre-existing Shiny application
    • Developing locally with RStudio
    • Developing locally using Docker
    • Speeding up deployments with Packrat
  • Configuration
    • Setting up a custom domain for your Shiny app
    • Installing additional system-level packages
    • Limiting the number of R Threads
  • Best Practices
    • File storage
    • Using promises
    • Adding routes
  • Troubleshooting
    • Resolving Application Error screen
    • Viewing app logs
    • Viewing resource consumption
    • Configuring Shiny session auto-reconnect
    • Getting support
Powered by GitBook
On this page
  • Example: Adding TeXlive
  • Example: Adding rJava
  1. Configuration

Installing additional system-level packages

PreviousSetting up a custom domain for your Shiny appNextLimiting the number of R Threads

Last updated 5 years ago

The Shiny toolchain is based on Ubuntu 18.04 (bionic). You can install any apt package present in .

Example: Adding TeXlive

First, create an Aptfile in your repository. Each line of the file represents a package. You can add as many packages as you need, however, it is best practice to keep the image small.

texlive-base

Now, build your application as specified in . Texlive-base will now be installed.

Example: Adding rJava

This is a more common requirement for R applications. As rJava requires some additional configuration commands, we'll be using onbuild rather than Aptfile which runs arbitrary commands.

Create a file named onbuild which looks like this:

#!/bin/bash
# install java jdk
apt-get update -q
apt-get install -qy --no-install-recommends openjdk-8-jdk openjdk-8-jre
rm -rf /var/lib/apt/lists/*

# configure R for Java
R CMD javareconf &> /dev/null

Install rJava to your project in R, and take a packrat snapshot.

install.packages("rJava")
packrat::snapshot()

You can always deploy immediately to Heroku which would build your application and produce the same results, but, testing locally first is always preferred.

Build your application as specified in . rJava will now be installed and enabled for your R appication.

Ubuntu's bionic repository
Developing locally with Docker
Developing locally with Docker