March 2019
Beginner to intermediate
464 pages
10h 57m
English
Different types of offers will work differently for different customers. In this section, we are going to look into what types of offers worked best for the engaged customers. Take a look at the following code:
## - Engagement Rates by Offer Type ##engagementRateByOfferType <- df %>% group_by(Renew.Offer.Type) %>% summarise(Count=n(), NumEngaged=sum(Engaged)) %>% mutate(EngagementRate=NumEngaged/Count*100.0)
As you can see from this code, we are grouping by the Renew.Offer.Type column, where we have four different types of offers. Then, in the summarise function, we count the total number of records using the n() function, and we count the number of engaged customers by summing over the encoded column, Engaged ...
Read now
Unlock full access