Introduction to R
Introduction
Acknowledgements
I am indebted to Dr Matt Castle, whose excellent “Introduction to R” practicals form the basis of this workshop.
Recommended reading
I heartily recommend the following books:
- Statistics: An Introduction Using R by Mick Crawley (2005);
- The R Book by Mick Crawley (2007).
“The R Book” is a fairly hefty tome, but is pretty comprehensive. “Statistics: An Introduction Using R” is an attenuated version of “The R Book” and provides a good introduction to using R, as well as a good grounding in common statistical methods using R.
Hadley Wickham and colleagues have also written many great R packages and several great books, some of which we will delve into in much more detail in other workshops:
- R for Data Science by Hadley Wickham and Garrett Grolemund (2016), also with a great companion website;
- ggplot2 by Hadley Wickham (2009);
- Advanced R by Hadley Wickham (2014), which has a useful companion website.
These books are all available in the University library.
Structure of this workshop
Many introduction to R workshops focus on the use of R as a statistical computing environment. This workshop focuses instead on learning how to use R as a programming and scientific computing environment. Once you have mastered the ideas in this workshop, you will able to pick up the material in the more advanced workshops much more easily. As such this forms a pre-requisite for many subsequent workshops.
R can be tricky to learn, so please feel free to e-mail any of the demonstrators with questions, though please make sure that you have thought through your question in advance. Most R problems can be solved with judicious use of Google and StackOverFlow…
In the workshop, R commands to be entered into the console are show in grey boxes e.g.
and similarly for the corresponding outputs:
## [1] 0.0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0
There is a downloadable PDF version of these notes if you prefer (available via the link next to the title at the top of the page), though I think the HMTL version is easier to work from.