View source: R/revenuemetric.R
RevenueMetric | R Documentation |
RevenueMetric
Creates a small multiple plot by sub-groups
RevenueMetric(
FUN = "Acquisition",
output = c("Plot", "Table", "Detail")[1],
by = c("day", "month", "quarter", "year")[4],
cohort.type = "None",
cohort.period = "year",
id,
value,
from,
to,
start = as.Date(min(from)),
end = as.Date(max(from)),
subscription.length = "year",
subset = rep(TRUE, length(id)),
profiling = NULL,
trim.id = 50,
mergers = NULL,
...
)
FUN |
A function that calculates a metric |
output |
Whether to output as a Plot, Table, or Detail |
by |
The unit of time to report on ("day", "month", "quarter", "year"). |
cohort.type |
How cohorts are to be used when performing the analysis
|
cohort.period |
The period of aggregation to be used, with options of |
id |
A vector of |
value |
A vector of containing the revenue per transaction. |
from |
A vector of class |
to |
A vector of class |
start |
The date at which the analysis outputs should
commence. By default, the earliest date recorded in
|
end |
The date at which the analysis ends, which is used to
determine churn. By default, the most recent date recorded in
|
subscription.length |
The time unit that describes the
subscription length: |
subset |
An optional vector specifying a subset of observations to be used in the calculations |
profiling |
Separate analyses are conducted among each unique combination of these variables. |
trim.id |
The maximum length of the strings to be used showing
ID names (used to avoid situations where string names are so
long as to make reading of tables impossible.
|
mergers |
A data frame with two variables 'id' and 'id.to'. 'id' contains the ids of companies that appeara, based on their data, to have churned, but have in fact merged with the corresponding 'id.to'. |
... |
Additional arguments to be passed to lower level functions. |
The cohort.type
parameter does not have the transitive properties
that many assume. For example, it's not always the case that "New"
is
equivalent to a diagonal from "Calendar"
, or that "None"
is
the column-sums of "Calendar"
.
Consider as an example CustomerChurn
where
all analysis is being done with the unit of "year"
. A customer that
purchases a contract less than the length of a year will appear below the
(possibly offset) diagonal in "Calendar"
and if they renew will be in
the denominator for the following year of "New"
, but not if they do
not renew.
Similarly, with RecurringRevenueChurn
, "New"
in an incomplete final
period will compare to the same period in the previous year, whereas the bottom
row of "Calendar"
will use the entire calendar yearear as the base, and
thus look much better (in a misleading way).
A plotly plot#?
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.