Understanding Loop expressions in R
when starting to use R, most R users use loops whenever they need to iterate over elements of vector, list or data frame. For e.g. if we are interested in the mean of all the numeric columns of the built-in iris data set, we could type, four times mean(iris$Sepal.Length), with each input variable name changing …