Skip to contents

[Stable]

Calculate bounds across a set of metrics.

Usage

MakeBounds(
  dfResults,
  dfMetrics,
  strMetrics = unique(dfResults$MetricID),
  dSnapshotDate = unique(dfResults$SnapshotDate),
  strStudyID = unique(dfResults$StudyID)
)

Arguments

dfResults

data.frame A stacked summary of analysis pipeline output. Created by passing a list of results returned by Summarize() to BindResults(). Expected columns: GroupID, GroupLevel, Numerator, Denominator, Metric, Score, Flag, MetricID, StudyID, SnapshotDate.

dfMetrics

data.frame Metric-specific metadata for use in charts and reporting. Created by passing an lWorkflow object to MakeMetric(). Expected columns: File, MetricID, Group, Abbreviation, Metric, Numerator, Denominator, Model, Score, and Threshold. For more details see the Data Model vignette: vignette("DataModel", package = "gsm").

strMetrics

Character vector of MetricIDs to include in dfBounds. All unique values from dfResults$MetricID used by default.

dSnapshotDate

Snapshot date. Uses dfResults$SnapshotDate by default. If more than one snapshot date is found in dfResults, a warning is thrown and this function returns NULL.

strStudyID

Study ID. Uses dfResults$StudyID by default. If more than one snapshot date is found in dfResults, a warning is thrown and this function returns NULL.

Value

A data frame.

Examples

dfBounds <- MakeBounds(
  dfResults = reportingResults,
  dfMetrics = reportingMetrics
)
#> Creating stacked dfBounds data for Analysis_kri0001, Analysis_kri0002,
#> Analysis_kri0003, Analysis_kri0004, Analysis_kri0005, Analysis_kri0006,
#> Analysis_kri0007, Analysis_kri0008, Analysis_kri0009, Analysis_kri0010,
#> Analysis_kri0011, and Analysis_kri0012
#> Warning: More than one SnapshotDate found. Returning NULL