Exercise

Refreshing your purrr memory

Let's pretend you're a data analyst working for a web agency. The web-design team has been running a weeklong A/B test that compares the performance of two design proposals for a website, and you're now in charge of analyzing the results.

The team measured the number of visits to the Contact page to determine the design's impact on the number of people contacting the company. These designs were presented to 2/3 of visitors.

visit_a contains the results from campaign A and visit_b the results of campaign B. Both are expressed as an average hourly number of visits. All the other stats you have are expressed as visits per day, so you need to convert these two. Then, you'll extract the mean of each vector.

Note that these are new data, not the one from the video.

Instructions

100 XP
  • Create the to_day() function, which multiplies x by 24.
  • Create a list that contains visit_a and visit_b.
  • Turn your new list to the daily number of visits with map() and the to_day() function.
  • Compare the mean of visits by mapping the mean() function on the results.