In R, loops are often not the most efficient way to do repetitive calculations. Rather than doing the calculations for each value of a variable it is much more efficient to organize the values of…
Loops are a basic element of all computer programming. In R, loops are somewhat less necessary than in many other languages because R can do vectorized calculations---calculations on all of the…
The ifelse() function evaluates a logical object (usually a vector-valued logical condition) and returns an object of the same dimension with TRUE values replaced by a value, or vector of values,…
In this video we introduce R. We give a brief overview of what R is; introduce CRAN (the Comprehensive R Archive Network website) and show how to find installation files, packages and documentation;…