Skip to main content

Quick Start


1. Downloading the latest R version#

It is necessary to have the R 4.0.5 version (or higher) installed in order to be able to run this code. R is a free software environment for statistical computing and graphics. It compiles and runs on a wide variety of UNIX platforms, Windows and MacOS. To download R., please choose your preferred CRAN mirror.. Please make sure you have restarted your R session once you have installed the latest R version.


2. Installing the package#

Please run remotes::install_github("facebookexperimental/Robyn/R") to install the package. If you haven't installed the remotes package previously, run install.packages('remotes')first.

Robyn requires the Python library Nevergrad. You must install it once for the code to work properly. Please find here more info about installing Python packages via reticulate.

  1. First step is to install the reticulate package via the following command: install.packages(‘reticulate’)
  2. Load the package using: library(reticulate)
  3. Install nevergrad. You have 2 options:
  • Option 1: nevergrad installation via PIP
virtualenv_create("r-reticulate")py_install("nevergrad", pip = TRUE)use_virtualenv("r-reticulate", required = TRUE)
  • Option 2: nevergrad installation via conda
conda_create("r-reticulate") # must run this line onceconda_install("r-reticulate", "nevergrad", pip=TRUE)use_condaenv("r-reticulate")

In case nevergrad still cannot be imported after installation, please locate your python file and run this line using your path:

use_python("~/Library/r-miniconda/envs/r-reticulate/bin/python")

For Windows, if you get openssl error, please see instructions here and here to install and update openssl.


3. Getting started with the demo.R script#

Open the demo.R script in the inst folder as a quick start guide that aims to cover most common use-cases. The demo will allow you to test the package using a simulated dataset.

Please follow our Demo.R script walkthrough within this website for extra guidance

inst folder