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 kri0001 and kri0002
#> Warning: More than one SnapshotDate found. Returning NULL