Video Tutorials: Intro to R
by reiverDo you want to learn R?
There is a great series of video tutorial on learning R that teaches the basic and sets you up to be a very competent R programmer.

R 1.1  Initial Setup and Navigation
Strategies that will make beginning R users more efficient: writing code using a "script" and navigating through directories within R.

R 1.2  Calculations and Variables
Get acquainted with performing basic computations in R, creating R objects (sometimes called "variables"), and seeing and running earlier commands that were run in the console.

R 1.3  Create and Work With Vectors
Learn how to create a vector in R using the c() function and the colonnotation (e.g. 1:5), find the length of a vector using the length() function, and subset vectors with bracketnotation and the head() and tail() functions.

R 1.4  Character and Boolean Vectors
So far we've seen objects that use numbers, but R is also built to handle more types of objects. Here we explore vectors that contain strings or Boolean values (TRUE / FALSE).

R 1.5  Vector Arithmetic
This video demystifies the different ways R performs vector arithmetic (e.g. addition and multiplication), covering topics including elementwise arithmetic, vector recycling, and how some functions are automatically applied across the elements in a vector. The seq() function is also introduced.

R 1.6  Building and Subsetting Matrices
Learn how to create a matrix with dimensions of your choosing, how recycle a vector when creating a matrix, and how to query specific characteristics of the vector using functions such as dim(), head(), and tail(). Details and potential pitfalls for subsetting a matrix using the bracketnotation are also covered.

R 1.7  Section 1 Review and Help Files
A quick review of the topics covered in the Section 1 videos: vectors, matrices, subsetting, and a few standard functions. Also learn how to access help files in R.

R 2.1  Loading Data and Working With Data Frames
Get a refresher on navigating directories on your computer in R, and learn to load a CSV (commaseparated values) data set in the form of a "data frame" using the read.csv() function, which is a special type of data matrix. This video also introduces factor variables and explores the data in a data frame using the dim(), head(), length(), names(), and subset() functions.

R 2.2  Loading Data, Object Summaries, and Dates
Learn how to load data in the form of a tabdelimited text file using the read.delim(), how to get a highlevel overview of an R object using the str() and summary() functions, and get a crashcourse into working with dates in R with an example highlighting why this skill is so useful.

R 2.3  if() Statements, Logical Operators, and the which() Function
ifelse statements are a key component to any programming language. This video introduces how to effectively use these statements in R and also clarifies some nuances of logical operators in R. Two related functions are also introduced: ifelse() as a shortcut that can be used to create faster and more readable code, and the which() function that retrieves the positions in a Boolean vector that are TRUE.

R 2.4  for() Loops and Handling Missing Observations
This video discusses for() loops, which are a structure that can be used to execute a set of code repeatedly. Also covered in this video are the min(), max(), and append() functions, as well as how to identify and omit missing values.

R 2.5  Lists
Learn how to create and use lists in R, which are dynamic, flexible R objects that can hold and organize other R objects.

R 3.1  Managing the Workspace and Variable Casting
View all the objects in the workspace using ls(), remove objects using rm(), cast a variable as a different type using an as.[type]() function, and use lists or data frames to organize data or results.

R 3.2  The apply() Family of Functions
When data are organized in a matrix or data frame, the apply() function can be used to calculate summaries (or apply a more complex function) across either the rows or columns of the data object. Or if summaries for each group (level) of one or more variables are desired, use the tapply() or by() function.

R 3.3  Access or Create Columns in Data Frames, or Simplify a Data Frame using aggregate()
The with() function makes it easy to access many variables (columns) in a data frame for oneoff calculations, the within() function can be used to create new columns that are merged with the original data frame, and aggregate() is useful for aggregating variables in a data frame across groupings based on one or more variables.

R 4.1  Basic Structure of a Function
This video introduces the basic structure of a function, covering the declaration of the function, using an argument, and returning a result.

R 4.2  Returning a List and Providing Default Arguments
Become more proficient in writing functions by learning the standard way to return more complex results from functions using a list, and learn how to specify a default value for an argument.

R 4.3  Add a Warning or Stop the Function Execution
The most helpful functions return clear warnings and errors when something is wrong. This video introduces the warning() and stop() functions, which can be used within a function to report a warning to the user or stop the function's execution.

R 4.4  Passing Additional Arguments Using an Ellipsis
Sometimes it is useful to be able to pass any extra arguments to another function. For example, if a new plotting function is created that makes use of the function called plot(), it would be useful to be able to be able to specify additional details to plot() automatically. This is possible using an ellipsis, "...".

R 4.5  Make a Returned Result Invisible and Build Recursive Functions
Use the invisible() function in place of return() in a function to prevent the output from printing to the user's screen but still allow the result to be stored into an R object. Additionally, when building a recursive function, use the Recall() function.

R 4.6  Custom Functions With apply()
In the last section of videos, the apply() function was introduced. A prebuilt function is often used in this function, but it is also common to write a new function within apply() or to apply a custom function.