kpi_cut: Cut KPI indicators

View source: R/kpi_cut.R

kpi_cutR Documentation

Cut KPI indicators

Description

Cut KPI indicators

Usage

kpi_cut(
  kpitab,
  breakpoints,
  risklabels = risklabs(breakpoints),
  riskcolors = riskcols(breakpoints),
  direction = c("increasing", "decreasing"),
  raw_cut = FALSE
)

Arguments

kpitab

output from calc_kpi

breakpoints

cut points (if KPIs use a traffic light system)

risklabels

labels for the cut points. By default, variations on low/moderate/high are used

riskcolors

colors for the cut points. By default, variations on green/yellow/red are used

direction

seriousness relative to breakpoints

raw_cut

add a group variable without applying risklabels

Examples

kpitab <- mtcars %>%
   kpitools:::kpi_calc("mpg", by = "am",
     kpi_fn = kpi_fn_median, txt = "MPG")
cutpoints <- c(0, 20, 30)
kpitools:::kpi_cut(kpitab, cutpoints, risklabels = c("Low", "High"))
kpitools:::kpi_cut(kpitab, cutpoints, risklabels = 1:2)
kpitools:::kpi_cut(kpitab, cutpoints)
kpitools:::kpi_cut(kpitab, cutpoints, riskcolors = c("pink","blue"), direction="decreasing")

CTU-Bern/kpitools documentation built on Aug. 19, 2024, 4:58 a.m.