Rainbow Deals - hours only!Up to 80% off on all courses and bundles.-Close
Creating functions
7. Calling a function with a vector argument
If statements


Nice work! Note that the following code of the count_age function involves two vectors:

current_year - birth_year

This means that the birth_year variable you pass in can really be a vector of one or more ages.


Recall that our survey data set has a column containing the birth years (birth_year) of various people. Pass in that column to the count_age() function we just created.