Explore UCD

UCD Home >

R Tutorials

A sample of tutorials demonstrating data analysis in R

Getting Started

Starting Data Analysis

Data files

Here is an overview of the datasets used in these worksheetsdivider

To install R

The homepage for downloading the latest R software is(opens in a new window)http://cran.r-project.org/.

Below we provide shortcuts directly to the installer files for Windows, Mac and Linux operating systems. If the downloads are slow you can select your nearest(opens in a new window)mirror site from this list

R for Windows

The installer for the latest version of R for Windows can be downloaded from (opens in a new window)http://cran.r-project.org/bin/windows/base/. The latest version will runon Windows XP and later (including 64-bit versions of Windows).

R for Mac

The installer package for the latest version of R for Macs can be downloaded from (opens in a new window)http://cran.r-project.org/bin/macosx/.

R for Linux

To install on a Linux machine go to(opens in a new window)http://cran.r-project.org/bin/linux/and select your distribution of linux from the list. Installation instructions for each Linux ditribution can be found in a README file.

divider

To install RStudio

(opens in a new window)Rstudiois a user interface for R that has a free open source version available for Windows, Mac and Linux operating systems.

To install RStudio go to(opens in a new window)https://www.rstudio.com/products/rstudio/download/and select the installer for your operating system under the "Installers for Supported Platforms" section. To complete the installation, save and open the installer and follow the installer's instructions.

divider

To install a package for R

The taught modules require three packages to be installed that do not come with R's base distribution: ggplot2, tidyr and emmeans. Here we describe how to install ggplot2. The other packages can be installed using the same approach.

(opens in a new window)ggplot2is a graphics package for R that adds to R's built-in graphical functions.

There are two ways to install ggplot2.

Method using RStudio

Follow steps 1-4 (see image below)

  1. Open RStudio, click on the Packages tab in the bottom right panel
  2. click on the install icon
  3. type "ggplot2" in the dialogue box underneath "Packages (separate multiple with space or comma)"
  4. click the install button

Method using just R

Open R and in the console window type

install.packages("ggplot2")

Ecological Modelling

University College Dublin, Belfield, Dublin 4, Ireland.
T: +353 1 716 7777 |