Returns the ledger attached by precise_dist() and precise_read() as the
"precise_dist_run" attribute, which accounts for every requested measure
including those absent from the returned rows.
Arguments
- x
An object returned by
precise_dist()orprecise_read().
Details
The ledger has one row per requested measure with the columns distance,
metric, type, status, reason, message, and time_taken_seconds.
status is completed, errored, skipped, or unavailable, plus
planned for a plan_only = TRUE run and pending for a measure never
attempted before an interrupted run was checkpointed. reason names the
cause, such as timeout, input_domain, time_budget,
degenerate_result, or worker_crash, and message carries the underlying
error text.
The ledger is an attribute and does not survive most data frame operations, so call this on the object as returned.
See also
precise_dist() and precise_read(), which attach the ledger.
Examples
data(data_cell_cycle, package = "PreciseDist")
cells <- c(1:4, 60:63, 118:121)
cell_cycle <- as.matrix(data_cell_cycle[cells, 2:41])
rownames(cell_cycle) <- paste0(data_cell_cycle$Cell_cycle[cells], "_", cells)
# "jaccard" requires binary input, so it is recorded rather than computed.
measures <- suppressWarnings(precise_dist(
cell_cycle,
dists = c("euclidean", "jaccard"),
verbose = FALSE
))
nrow(measures)
#> [1] 1
precise_run_report(measures)[, c("distance", "status", "reason")]
#> # A tibble: 2 × 3
#> distance status reason
#> <chr> <chr> <chr>
#> 1 euclidean completed NA
#> 2 jaccard errored input_domain