Reads a collapsed column of numeric timestamps (or day numbers, or any ordered numeric marker) and compares `max - min` – how long the record was active for – between the two sides.
Arguments
- dat_raw_anon
dataframe of raw_anon form
- target
target column
- row_number
name of the row-number column *before* the RAW_/ANON_ prefixing done by [join_raw_anon_data()] (default: "ROW_NUMBER")
- split
literal separator between the elements of the collapsed column (default ":")
- method
passed to the same comparison [score_count()] uses
- generalized
what to do when `target` turns out to hold generalised values on the ANON side: `"stop"` (default), `"warn"` or `"ignore"`.
- .fn_name
name used in error messages; a function that wraps this one passes its own name so the message points at the function the user actually called
Details
The span is a different fact from both the number of events and their shape: twenty purchases in one week and twenty spread over two years describe different people. Comparing spans with `method = "log_ratio"` for the same reason [score_count()] does: the difference between a one-day and a one-month span matters far more than between two and three years.
Examples
raw <- data.frame(ROW_NUMBER = 1:3, T = c("1:2:3", "1:40", "5:6:7:80"))
match_greedy(score_span(join_raw_anon_data(raw, raw), "T"))
#> ANON_ROW_NUMBER RAW_ROW_NUMBER CONFIDENCE RESULT
#> 1 1 1 1.5137641 TRUE
#> 2 2 2 0.4758222 TRUE
#> 3 3 3 0.3751024 TRUE