Quantcast
Channel: Active questions tagged r - Stack Overflow
Viewing all articles
Browse latest Browse all 201894

Calculate Retention Rate on one column in R

$
0
0

I would need your advice as I am struggling to find out the right command in R.

Basically I would like to calculate the retention rate for the specific customers. The customer_math is the snapshot of when the customer was active, which includes a time range of 8 years.

customer  customer_math
Apple          1
Tesco          10
Nespresso      1001
Dell           11
BMW            11111100

The final dataset should look like this:

customer  customer_math      retention_rate
Apple          1                1
Tesco          10               0.5
Nespresso      1001             0.5
Dell           11               1
BMW            11111100         0.75

Any ideas of how I can solve my problem?

Your help is very appreciated! Thanks!


Viewing all articles
Browse latest Browse all 201894

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>