R for Sport Scientists – Fundamentals Course: Control Flow

R for Sport Scientists – Fundamentals Course

Lecture 5: Control Flow

In this lecture, I am going to show you how you can control the flow of the R program using choices and loops. Loops should be generally avoided in R (since they can be slow, and there are specialized functions and packages for looping through objects), but it is important to understand them since sometimes they cannot be avoided.

Before explaining choices and loops, in the first video, I will cover some basic input and output from/to the console.

The second video will cover flow control using choices (i.e., if and switch commands as well as vectorized if statement using ifelse).

In the third video, I will explain the loops using the for, while, and repeat commands.

The fourth video is reserved for a solution to the unseeing game problem that I have given as an exercise to do yourself. Please do not watch the fourth video before you tried to solve the problem yourself. Programming is learning by solving (your own) problems, rather than following solutions.

Ready to watch this course?
Become a member and get unlimited access to all content on our website.

Get Instant Access to Our Knowledge Base

Start Your FREE Trial Now!

Find Out More


Course Overview

Lecture 1: Introduction

Lecture 2: Installation

Lecture 3: Vectors

Lecture 4: Subsetting

Lecture 5: Control Flow

Lecture 6: Functions

I am a physical preparation coach from Belgrade, Serbia, grew up in Pula, Croatia (which I consider my home town). I was involved in physical preparation of professional, amateur and recreational athletes of various ages in sports such as basketball, soccer, volleyball, martial arts and tennis. Read More »

Welcome to Complementary Training Community! Forums R for Sport Scientists – Fundamentals Course: Control Flow

Tagged: ,

This topic contains 0 replies, has 1 voice, and was last updated by  Mladen Jovanovic 1 week, 1 day ago.

You must be logged in to reply to this topic.