Installing swirl on Fedora 22

swirl is an R package that turns the R console into an interactive learning environment. Here there are instructions to install swirl on Linux, but they have been tested only on Ubuntu and its derivatives.  Although an installing swirl on Fedora follows the same instructions in general, there are some differences.

1. Install the most recent version of R

The latest version of R is in standard Fedora repository, so we can install it using Yum Extender or a command

$ sudo dnf install R
// or for versions of Fedora before Fedora 22
$ sudo yum install R

When the installation will be finished we can confirm that we have the last version  of R with the command

$ R --version

2. Get RStudio

We can download the recent version of RStudio from https://www.rstudio.com/products/rstudio/download/

3. Install libcurl

libcurl is required for the RCurl package, which swirl uses to download courses from the internet. We can install libcurl using Yum Extender or a command

$ sudo dnf install libcurl 
$ sudo dnf install libcurl-devel

4. Install and run swirl

From command line of R or RStudio we can install and run swirl

> install.packages("swirl")
> library(swirl)
> swirl()