CommencerCommencer gratuitement

Another purrr refresher

You just received visit_c, the number of visits on the website during the same week, but with the old design, which was shown to 1/3 of website visitors. You now want to compare these visit_c, with two previous design, visit_a and visit_b, to know which one led to more visits of the Contact page.

Again, you'll need to turn all the visitor lists to the daily number of visits.

You've been asked to provide two insights:

  • A plot for each element
  • The total number of visits for each day, regardless design

You'll test out both map() and walk() for plotting. Both return the "side effects," that is to say, the changes in the environment (drawing plots, downloading a file, changing the working directory…), but walk() won't print anything to the console.

Cet exercice fait partie du cours

Intermediate Functional Programming with purrr

Afficher le cours

Exercice interactif pratique

Essayez cet exercice en complétant cet exemple de code.

# Create all_tests list  and modify with to_day() function
all_tests <- ___(visit_a, visit_b, visit_c)
all_tests_day <- ___(all_tests, ___)
Modifier et exécuter le code