Quick introduction to R and Rstudio
This is a basic introduction to R and RStudio. The exercises in this series are a subset of the exercises found in the Dodona course of Prof. Lieven Clement “Statistiek: introductie tot R” and the course “Statistical Modelling & Data Mining” by Prof. Dries Benoit.
Making these exercises is optional, but recommended for those students with no or limited R/RStudio skills.
Title | |||
---|---|---|---|
1.1. Why R? | |||
R and RStudio | |||
36.1 Installing R | |||
36.2 Installing RStudio | |||
Scripts | |||
RStudio Interface | |||
Installing R packages | |||
Asking questions in Dodona | |||
Google is your best friend | |||
Acknowledgments | |||
2.1 Case study: US Gun Murders | |||
2.2 The very basics | |||
2.3.1. Sum of integers 1,...,100 | |||
2.3.2. Sum of integers 1,...,1000 | |||
2.3.3. Interpret code | |||
Functions | |||
2.3.4. Nested functions | |||
Removing Variables | |||
Data types | |||
2.5.1. Variables in a dataframe | |||
2.5.2 Variable names | |||
2.5.3 Examining Variables | |||
2.5.4 Multiple ways to access variables | |||
2.5.5 Factors | |||
2.5.6 Tables | |||
Matrices 1 | |||
Matrices 2 | |||
Matrices 3 | |||
Indexing Matrices 1 | |||
Indexing Matrices 2 | |||
2.6 Vectors | |||
2.7 Coercion | |||
2.8.1-5. Vectors | |||
2.8.6. Vector of numbers 12..73 | |||
Sequencing | |||
2.8.7. Odd numbers | |||
Adding Vectors and Vector Length | |||
2.8.9. Class of seq(1, 10, 0.5) | |||
2.8.10. Class of seq(1, 10) | |||
2.8.11. 1 vs 1L | |||
Vector cast | |||
Convert Vector Type | |||
2.9 Sorting | |||
Sorting 1 | |||
Sorting 2 | |||
Sorting 3 | |||
Sorting 4 | |||
Sorting 5 | |||
Sorting 6 | |||
Missing values (NA) 1 | |||
Missing Values (NA) 2 | |||
2.11 Vector arithmetics | |||
Convert Temperatures | |||
2.12.2. Vector Sum | |||
2.12.3. Vector Mean | |||
2.13 Indexing | |||
Indexing 1 | |||
Indexing 2 | |||
Indexing 3 | |||
Indexing 4 | |||
Indexing 5 | |||
Randomisation | |||
Basic Plots 1 | |||
Basic plots 2 | |||
2.16.1. Scatter Plot | |||
2.16.2. Histogram | |||
2.16.3. Boxplot | |||
3.1 Conditional expressions | |||
3.6.1 Conditional expression | |||
3.6.3 Conditional changes | |||
3.6.2 Any and all | |||
3.2 Defining functions | |||
3.4 For-loops | |||
3.5 Vectorization and functionals | |||
3.6.7-8 Sum of the first n squares (I) | |||
3.6.9 Sum of the first n squares (II) | |||
Loading Data - Introduction | |||
Loading Data - Working Directory | |||
Loading Data - Text versus Binary Files | |||
Loading Data 1 | |||
Loading data 2 | |||
Loading data 3 |