tapply() Function in R (R Tutorial 1.15)

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



Could u make a video on How to make a heat map or density map in rstudio using ggmap or leaflet package.

Angel Ang says:

Thanks for your videos and work. Waiting another one with probability 1.

Shreya soni says:

What if we want to find the mean Age of Female Smokers ? What command do we run ?

Avishek Chakraborty says:

Error in tapply….object ‘Smoke’ not found…cud u help me out with this. Also have checked by replacing smoke with caesarean.It then gave ,object caesarean not found

katerina liu says:

clear and understandable tutoring

 Write a comment


Do you like our videos?
Do you want to see more like that?

Please click below to support us on Facebook!