Summary and Schedule
Programming with R for Official Statistics is for those who are looking to start using R in the production of Official Stastics. Over 2 days, participants will learn the basics of R, data manipulation, and best practices that they can employ in their work. Participants will learn how to make reuseable code that others can read and use in the future.
Prerequisites
There are no prerequisites for this course
Setup Instructions | Download files required for the lesson | |
Duration: 00h 00m | 1. Introduction to Programming |
What is programming? What is object oriented programming? How do I document code? What is a directory? |
Duration: 00h 15m | 2. R Fundamentals |
How do I use the RStudio IDE? How do I read data into R? What is a data frame? How do I access subsets of a data frame? How do I calculate simple statistics like mean and median? What is plotting? How do I install and use packages? |
Duration: 01h 15m | 3. Data Types and Structures |
What are the different data types in R? What are the different data structures in R? How do I access data within the various data structures? |
Duration: 01h 55m | 4. Functions |
What is a function? How do I make a function? How can I test my functions? How should I document my code? |
Duration: 02h 10m | 5. Making Choices |
How do I make choices using if and else statements? How do I compare values? |
Duration: 02h 40m | 6. Loops in R |
How can I do the same thing multiple times more efficiently in
R? What is vectorization? Should I use a loop or an apply statement? |
Duration: 03h 10m | 7. Plotting |
How can I use ggplot2? What is a geom? How can I use ggplot2 to create a scatterplot? What other types of plots can I make with ggplot2? |
Duration: 03h 25m | 8. Dealing with Messy Data |
What do I do if my data is the wrong class? What is an NA? What if my data has missing values? How do I change decimal points and rounding in numeric data? What if text strings have different cases? |
Duration: 03h 55m | 9. Best Practices for Writing R Code | How can I write R code that other people can understand and use? |
Duration: 04h 10m | 10. Understanding Factors |
How is categorical data represented in R? How do I work with factors? |
Duration: 04h 40m | 11. Outputting Data |
How can I put my text, code, and results all in one document? How do I use knitr? How do I write in Markdown? |
Duration: 05h 00m | Finish |
The actual schedule may vary slightly depending on the topics and exercises chosen by the instructor.
This lesson assumes you have current versions of the following installed on your computer:
- the R software itself, and
- RStudio Desktop.