1. Downloading the latest R version
It is necessary to have the R 4.0.0 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.
Optional (and recommended): after you've installed R, you may install RStudio IDE for a better and smoother experience. RStudio IDE is a set of integrated tools designed to help you be more productive with R and Python. It includes a console, syntax-highlighting editor that supports direct code execution, and a variety of robust tools for plotting, viewing history, debugging and managing your workspace.
2. Installing the package
To install or update Robyn to the latest stable version of the package, run:
NOTE: If you're interested in installing the latest or a specific dev version instead, run
remotes::install_github("facebookexperimental/Robyn/R"). If you haven't installed the
remotes package previously, run
Robyn also 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.
- First step is to install the reticulate package (if you haven't before) and load it:
nevergradPython library. You have 2 options:
- Option 1: using PIP
py_install("nevergrad", pip = TRUE)
use_virtualenv("r-reticulate", required = TRUE)
- Option 2: using conda
conda_install("r-reticulate", "nevergrad", pip = TRUE)
In case nevergrad still cannot be imported after installation, please locate your python file and run this line using your path:
3. Getting started with the demo.R script
Open the demo.R script in the
Robyn/demo/ 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.