Set up R and RStudio

Introduction

R language implementations are freely available for Macs and Windows and and can be installed from any of the CRAN (Comprehensive R Archive Network) mirrors. RStudio is an IDE (Integrated Development Environment) for R and is also available in a free version.

  1. Go to the CRAN website and download it for your Mac or PC. (We assume no one is using Linux; if you are that advanced, then you already know what to do!)

  2. Install the free RStudio version.

RStudio makes it very easy to learn and use R, providing a number of useful features that many find indispensable.

R Packages to run examples

To run the examples we talk about today, you nee some packages to be installed. In the R console in Rstudio, you can execute what’s below.

options(repos = "https://cran.rstudio.com")
install.packages(c("distcomp", "homomorpheR", "CVXR"))