View source: R/mode_calculation.R
mode_calculation | R Documentation |
Calculates the mode of time intervals between purchases for each package. Intervals within 2 days are grouped together. The most common (modal) interval is selected from the grouped values. If multiple modes exist, the one closest to the median is chosen; if there's still a tie, the one closest to the mean is selected. Intended for internal use in the PRE2DUP-R package.
mode_calculation(pack_id, pre_ratio, dur, report_iters = 50)
pack_id |
vector of package identifiers |
pre_ratio |
vector of package ratios, i.e. number of packages because partial packages are not allowed |
dur |
vector of times between purchases |
data.table with the most common duration between purchases
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.