concept walk in category R

appears as: walk, walk, The walk
Machine Learning with R, the tidyverse, and mlr

This is an excerpt from Manning's book Machine Learning with R, the tidyverse, and mlr.

2.7.4. Using walk() to produce a function’s side effects

Sometimes we want to iterate over a function for its side effects. Probably the most common example is when we want to produce a series of plots. In this situation, we can use the walk() function to apply a function to each element of a list to produce the function’s side effects. The walk() function also returns the original input data we pass it, so it’s useful for plotting an intermediate step in a series of piped operations. Here’s an example of walk() being used to create a separate histogram for each element of our list:

Figure 2.6. The result of “walking” the hist() function over each element of our list using walk()