What is R?

R is both a coding language, and an open source software system

R can be used to analyse and present many different types of data. It is widely used in the life and social sciences, including ecology and conservation

R is a sophisticated programming language used and supported by a global community. It is freely available to download from the R project website here

We can use R to check and correct our survey data, run statistical analyses and create figures to illustrate patterns in our data

R is composed of base R, and packages, which are tools and analyses developed by individuals or teams with specialist knowledge, and made available to the community. For example, specialised packages exist for analysing:

Why use R?

So why do we use R? Here are some general reasons:

  • It’s free!  You don’t need to buy a licence to use it, or break the law by using pirated software
  • It’s platform-independent, so it works on Windows, Mac and Unix-based systems
  • It’s stable, powerful & versatile
  • It includes cutting-edge applications, which are constantly being developed and updated
  • It’s based on a simple object-oriented programming language
  • It has many built-in functions which can be extended by the user
  • It has a strong user community who are willing to offer help and guidance in response to specific questions or problems

Reasons which are of particular relevance to conservationists and researchers:

  • It is the standard analysis tool for ecologists and conservationists, enabling you to share code and understand analyses by colleagues and collaborators
  • It’s easy to create a record of what you did and adapt the same analysis to new data
  • It has very flexible graphics and can make high quality illustrations for professional publications
  • You can store commands (functions) for efficient and rapid execution or for editing later.  This record helps you remember how you arrived at a particular result, particularly if you add comments explaining what each line of code does!

Barriers to using R

What makes it harder to learn R?

You’re used to menus, not code

You may never have done any programming before, and only used software with drop-down menus like SPSS, Minitab and Excel

R is a programming language, so you write code to tell the software what to do, instead of using menus. The lack of a GUI1 can feel daunting at first

The advantages of code are that:

  1. The script2 forms a record of what you did: how you processed data, ran your analysis etc
  2. You can edit your script to adapt your analysis
  3. You can easily run the same analysis on new data
  4. You can share your script with others

You’re used to spreadsheets

Rather than entering data or formulae into cells, as in a spreadsheet, R is controlled by typing things into the command-line

A screenshot of the R project website

Back to top

Footnotes

  1. GUI: graphical user interface↩︎

  2. script: file you write code into and save↩︎