Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Part 2 - more dplyr I have uploaded a data set called dr 4 . Rdata. It contains the dates that fictional users visited a

Part 2- more dplyr
I have uploaded a data set called dr4. Rdata. It contains the dates that fictional users visited a fictional website. The
website is able to track if the same user visited the site more than once. For the particular date range, the site had
395 visitors, and 130 of them visited more than once. Some of them (13 people) visited the site 5 times.
Using dplyr, find the average time between repeated visits to the site.
You will want to find the total average.
Be careful when calculating this.
For example, the first user to visit the site more than once (row 2,,YPELGRZNOQUTNPOH) visited on 6-29,7-27,
8-3, and 8-11. The time difference for the repeated visits are: 28 days, 7 days, and 8 days, respectively, for an average
of 14.33 days.
The next user with repeated visits is row 3(SNTCUXUDIHCCSPJA). This person visited on 6-15 and 8-17, a
difference of 63 days.
If your data set had only these two rows, the average time between visits would be 28+7+8+634=26.5
days. It is not 14.33+632=38.66 days.
When I first attempted this, I used filter(), mutate(), rowwise(), ungroup(), and summarise(). Upon further
review, I realized that it is entirely possible to complete this task using only filter () and mutate() commands. I
do not care what combination of commands you use. I do care that you get the correct final result.
Make sure your final output shows the desired average number of days between visits.
image text in transcribed

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions

Question

What is linear transformation? Define with example

Answered: 1 week ago

Question

Discuss five types of employee training.

Answered: 1 week ago

Question

Identify the four federally mandated employee benefits.

Answered: 1 week ago