TUTORIAL: BEGINNING WORK IN R.-

Introduction: R is a powerful open source platform for statistical modeling and graphing that is widely used in science including in ecology and evolution. Operations are conducted by typing scripts into a command prompt so it is more complicated than point and click menu based programs. However, R is much more flexible and powerful. Because it is open source, there is also an enormous community of researchers developing specialized packages that run in R. There are a very large number of packages for almost any scientific application imaginable. Of course, one can also conduct basic statistical analysis in the base R program.

Downloading R and R Packages: To begin working with R, you should have R downloaded on your computer. It is hosted at the Comprehensive R Archive Network (CRAN) site. You can download the latest version. I recommend running R in RStudio. While you are at it, you can downloas ggplot2 and the Tidyverse package, so they are ready to use (follow instructions in the links above). RStudio is a popular interface for R and ggplot2 is the most popular graphing package for R.

To begin, open RStudio. Then load ggplot2 by selecting it in the bottom right window under the Packages tab:



Importing data: The easiest way to import data into R is to collect it in an Excel spreadsheet. The spreadsheet can include the variable names as headers at the top of the columns. There should be no empty spaces either in the data or in the variable names. Underscores, "_", can be used as a separator instead of spaces. The spreadsheet can be saved as tab-delimited text file and then imported into R.

Once this is done, you are ready to move on to other tutorials. Good luck!



Date last modified: Dec/8/22
Date created: Aug/14/19 (by: Windsor Aguirre)