mrrAtDateType: Calculate MRR for a specific date and product type

Description Usage Arguments Value Author(s) Examples

View source: R/mrrAtDateType.R

Description

It calculates the MRR given date, subscription data, and product type

Usage

1
mrrAtDateType(time_point, subs, type = NULL)

Arguments

time_point

a date value (have to be date type)

subs

subscription data, need to have columns: account_id, user_id, Product, Effective_Start, Effective_End, MRR

type

product type, if "NULL", it will return MRR for each product

Value

a vector of MRR is returned

Author(s)

Hui Lin, longqiman@gmail.com

Examples

1
2
3
4
5
6
7
## Not run: 
add_ons <- c("Forms", "Functions", "Identity", "Domains", "Large Media")
dates <- seq(as.Date("2018-02-01"), lubridate::ceiling_date(Sys.Date(), unit = "month"), "months") - days(1)
dates
add_ons_mrr <- sapply(dates, function(time_point) {mrrAtDateType(time_point, datall_revenue, add_ons)})

## End(Not run)

netlify/NetlifyDS documentation built on Aug. 8, 2020, 4:17 a.m.