R for Everyone
1 Introduction
These materials will teach you the fundamentals of R and are intended for beginners. The first section will focus on the basics of R with foundations and objects. Next you will look at how to read in files and write out files from R. This will be followed by getting further practice on the completed materials whilst learning some handy tips and tricks.
You will then get to apply your R skills to create plots and carry out some statistics. You will learn how to make four types of plots with R:
- Line graphs
- Histograms
- Scatterplots
- Boxplots
You will then be carrying out some basic statistics, don’t worry it won’t be a statistics lesson.
The materials will finish with some harder coding where you’ll learn to make loops, use ifs, and create R functions.
These materials will involve theory, practice, exercises, and solutions:
- The theory will explain R concepts and terminology. R terminology can be quite confusing but it is important to learn as it makes asking questions online a lot easier.
- Practice will involve code to run whilst reading through the theory. This will allow you to see the output of R and hopefully help you understand how R works.
- Exercises will give you a task to carry out based on the knowledge and skills you learned from the theory and practise.
- Solutions for the exercise are after the exercise. Please try the exercise before looking at the solution, however make sure you read the solutions even if you completed the exercise successfully as there is extra information in these sections.
Commands are in the following font and colour and should be run in RStudio (These should not be copied into R from this document):
This is a command
This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.