Exercise

Exploring data with predicates

We will continue our exploration of A/B test data. Your manager is not interested in which days reached the threshold, he wants to know if every day reached the threshold or if some days reached the threshold. We'll use purrr predicates to answer these questions.

You have received several thresholds and decided to write a script that will start with this threshold definition, and answer, for each design, if all the days have reached the threshold, and if not, if some did.

The results from this A/B test are in the all_visits list.

Instructions

100 XP
  • Create a variable called threshold, that contains the number 160.
  • Create a new mapper, that will test if .x is over threshold.
  • Combine map() and every() to test if all elements are over the threshold.
  • Combine map() and some() to test if some elements are over the threshold.