Reusing Environments

1. Build the Environment

Build a computational environment that includes the software you need by installing software using code cells as shown below. For complete documentation on this process, see How to Install System Packages.

1.1. Installing System Packages

Install system packages with apt-get like the example below:

apt-get update
apt-get install -y nodejs npm
npm install -g coinmon

After installation, you are able to use the software that you installed:

coinmon -t 5

1.2. Installing Language Specific Packages

You can use language specific commands such as install.packages() in R to install the software of your choice.

install.packages("rsvg")

If you need to use Bash to install packages into an R runtime, you need a 'Bash in R' code cell.

To create this code cell, click inside an R code cell, then use the insert menu to insert 'Code Cell: Bash'.

apt-get update
apt-get install librsvg2-dev

2. Export the Environment

Once dependencies are installed, export the environment by checking the box in the runtime settings menu as seen below:

3. Publish the Article

Publish the Article containing the environment by clicking the publish article button on the toolbar, choosing a name for the environment, and clicking the Publish now button.

4. Importing a Computational Environment to a New Article

For a better understanding of reusing environments, please read Transclusions.

To use an environment you created:

  • Create a new article
  • Add a code cell
  • Click the runtime settings icon
  • Click the pulldown menu next to Environment
  • Scroll down and click Import Environment
  • Type the name of the published environment and click on it when it appears
  • You will now be able to use the previously created computational environment in your new article
  • Click the runtime settings icon
  • Click the pulldown menu next to Environment
  • Scroll down and click Import Environment
  • Type the name of the published environment and click on it when it appears
  • You will now be able to use the previously created computational environment in your new article