Learn how to use the “tapply()” function in R, to apply a function to subsets of a variable or vector. The tapply function essentially is a specialized loop/subsetting function, although it is more efficient than a simple use of sure brackets or a “subset” command. The tapply function allows the user to divide a variable into multiple groups based on another variable(s) used to define the groups/subses, and then apply a function to each of the groups/subsets.
This video is a tutorial for programming in R Statistical Software for Statistics and Data Science beginners, using RStudio.
You can access the dataset and R script (tApply Function) here:
Visit www.statslectures.com for more videos and tutorials on R