An Introduction to R

Prof Chris Brunsdon

National Centre for Geocomputation

MUSSI

Maynooth University

September 22nd, 2022

What is R?

Figure 1: R and RStudio in action

  • R is a system for statistical computation and graphics. It provides, among other things, a programming language, high level graphics, interfaces to other languages and software tools and debugging facilities.

  • Versions exist for

    • Windows
    • Mac
    • Linux

A number of packages can be added to R to extend its functionality. Notably:

  • sf: Enables R to work with geospatial data
  • tidyverse: Allows R to process data in a database query like syntax
  • Several packages for spatial statistical data analysis
    • mgcv: x,y,z trend modelling
    • terra: Processing raster data - eg remote sensing
  • tmap: Interactive web-based mapping
  • Fuller list here

Nothing.

R is available as Free Software under the terms of the Free Software Foundation’s GNU General Public License in source code form.

Tip

This also means the code used to create R and all of its packages are Open Source, so all code used is open to scrutiny.

  • Use the CRAN website
    • This lets you download R and install it
  • Also go to the RStudio web site and download RStudio
  • This is an editor and development environment for R
    • Write code
    • Test it
    • Check graphics
    • Publish blogs and web sites
    • More …

R in a Geospatial Context

Weapon Violations Aug 1st 2022

R in Practice

Limitations

Where is R Heading?

Learning to use R