Session Ready
Exercise

Lambda functions

We are still working with the results of a weeklong A/B test on a website. The three vectors containing the number of visits for each design (visit_a, visit_b and visit_c) are available in your workspace.

One of your colleagues has asked you to transfer him the results, but he wants them to be rounded to the nearest ten. To do this, you will need to call the round() function this way:

Rounding to a negative number of digits means rounding to a power of ten, so for example round(x, digits = -2) rounds to the nearest hundred

Definition taken from R documentation: see ?round

Make sure to use the right map_* for each call.

Instructions
100 XP
  • Round visit_a to the nearest ten with a mapper.
  • Create a reusable mapper object called to_ten, that rounds to the nearest ten.
  • Map to_ten to visit_b.
  • Map to_ten to visit_c.