Today we will be using Rstudio.
RStudio makes R easier to use. Its an IDE including a console, a syntax-highlighting code editor, and tools for debugging, visualization and workspace management. Importantly, it helps us documenting everything that we do.
- Code editor: write R scripts
- R Console: interactively type R commands and see output
- Workspace: view objects / searchable command history
- Plot pane / files / R package manager / Integrated R help
- Organize your scripts as projects (File | New Project...)
- Under the
Filemenu, click onNew project, chooseNew directory, thenEmpty project - Enter a name for this new folder, and choose a convenient location for it. This will be your working directory for the rest of the day (e.g.
~/R_course) - Click on
Create project - Under the
Filestab on the right of the screen, click onNew Folderand create a folder nameddatawithin your newly created working directory. (e.g. `~/R_course/data) - Create a new R script (File > New File > R script) and save it in your working directory (e.g.
R-course-script.R)
We’re going to spend a bit of time using a data set. You can download this from here (http://nicercode.github.io/intro/data/seed_root_herbivores.csv) and put it into the data directory. Download this file, open the R_course/data folder and move it there. Similarly, also grab this file (http://nicercode.github.io/intro/data/seed_root_herbivores.txt) and put it in the data directory too.
- open source software under GPL
- widely used both in academia and industry
- available on all platforms
- not just for statistics, but also general purpose programming
- use Google (e.g. with an error message)
- If you know the name of the function, you can use the built-in help:
?round - If the function is part of a package that is installed on your computer but don’t remember which one, you can type:
??kruskal - search the R package documentation https://www.rdocumentation.org/
For this course we will use Rstudio and R (any version). You can get R from https://cran.r-project.org/index.html and Rstudio from https://www.rstudio.com/products/rstudio/download/

