Recursion usually indicates repetition. In the data analysis journey, you might need to use a single function multiple times to do a task such as calculating summary statistics for each column in a dataset. Sometimes, you might need to write a function in such a way that you need to use the function itself within that function. In this recipe, you will learn both how to use a function for multiple columns or rows in a data frame and how to write a function that can call the function itself.
Making a recursive call to a function
Getting ready
This recipe has two parts. The first part is to use a function on a different subset or rows or columns of a data frame. The second part of this recipe is to write a function that can...