db_functions {segmetric} | R Documentation |
Database of metrics functions
Description
These functions are used to register new metrics in the segmetric
database.
-
sm_list_metrics()
: List all registered metrics. -
sm_new_metric()
: Create a new metric entry to be registered in the database. -
sm_reg_metric()
: Register a new metric in the database. -
sm_unreg_metric()
: Remove a metric entry from the database. -
sm_desc_metric()
: Describe a metric registered from the database.
Usage
.db_list()
.db_set(key, value)
.db_del(key)
.db_get(key)
sm_list_metrics()
sm_new_metric(
fn,
fn_subset,
name = "",
optimal = 0,
summarizable = TRUE,
description = "",
reference = ""
)
sm_reg_metric(metric_id, entry)
sm_unreg_metric(metric_id)
sm_desc_metric(metric_id)
Arguments
fn |
A |
fn_subset |
A |
name |
A |
description |
A |
reference |
A |
metric_id |
A |
entry |
A |
Value
-
sm_list_metrics()
: Returncharacter
vector with supported metrics. -
sm_new_metric()
: Return ametric_entry
object containing the metric function (fn
), name (name
), description (description
), and reference (reference
). -
sm_reg_metric()
,sm_unreg_metric()
: No return value, called to (un)register a metric. -
sm_desc_metric()
: No return value, called to print a metric description.
Examples
sm_reg_metric(
metric_id = "Example",
entry = sm_new_metric(
fn = function(m, ...) {
sm_area(sm_ytilde(m)) /
sm_area(sm_ref(m), order = sm_ytilde(m))
},
fn_subset = sm_ytilde,
name = "Metric name example",
description = paste("Values range from A to B.",
"Optimal value is C"),
reference = "Author (Year)"
))
sm_desc_metric("Example")
sm_list_metrics()