Ny sökning
PNG0101

Understanding and coding the R programming language

The course is about R as a language, to allow participants to understand the code to read and write. It will start from a very basic level and teaches many of the principles that are necessary to be able to write your own programs in R but are usually skipped over in the rush to do some ‘stats’. . It is ideal for people who: (1) have never used R before, or (2) use it but don’t really understand what they are doing or (3) use it at a basic level and want to develop their programming skills (e.g. how to do loops, write their own functions or do graphics). The course is NOT about statistics. Because people on the course will come from diverse backgrounds, the methods we teach will be general enough so they can be applied to any research question.

Day 1: The building blocks of R programming

1. Introduction to objects and functions in R

2. How R stores information - vectors & matrices

3. The 3 vector principles - recycling, vectorisation and indexing

4. How data are represented - Lists & data frames

Day 2: Programing for automating processes

1. If-else statements

2. Loops and programming repetition

3. Programming functions

Day 3: Plotting and graphics

1. The basics of plotting

2. Manipulating plot parameters

3. Adding shapes, lines, points and text

4. Combining multiple plots

Day 4: Additional concepts and exercises

1. Writing clear code

2. Debugging

3. Dates and time in R

4. Manipulating datasets

5. Exercises of increasing complexity

Day 5: Statistical objects

1. Linear models and GLMMs

2. Storing and manipulating statistical objects

3. Creating and visualizing model predictions

4. LOTS more exercises!



Course structure

The course runs for 5 days with each day beginning at 8:45 and finishing at ~17:00 with 1 hour for lunch and 2 fika breaks. Each day is a combination of lectures and exercises with an in-class computer exercise introduced after every new concept. During these exercises the teachers will work with the students to help them achieve the objective of each task, and to answer any questions regarding the concepts. This allows us to provide immediate help for students that have difficulty with any concept.

Kursplan och övrig information