gainsChartDT: Produce a gains chart datatable

Description Usage Arguments Value See Also Examples

View source: R/gainsChartDT.R

Description

gainsChartDT produces a nicely formatted DT::datatable representation of a mt_gainsChart object.

Usage

1
2
3
gainsChartDT(x, scoreFormatType = "int", scoreFormatDigits = 5,
  contSumFormatType = "dlr", contSumFormatDigits = 0,
  contAvgFormatType = "dlr", contAvgFormatDigits = 0, KScolor = "#FF3005")

Arguments

x

mt_gainsChart object

scoreFormatType

character string; format type for score field(s); valid values are "int", "dlr" and "pct"

scoreFormatDigits

non-negative integer value; number of decimal places for score field(s)

contSumFormatType

character string; format type for continuous sum field(s); valid values are "int", "dlr" and "pct"

contSumFormatDigits

non-negative integer value; number of decimal places for continuous sum field(s)

contAvgFormatType

character string; format type for continuous average (mean) field(s); valid values are "int", "dlr" and "pct"

contAvgFormatDigits

non-negative integer value; number of decimal places for continuous average (mean) field(s)

KScolor

character string; text color for max KS value (valid color)

Value

A datatable representation of a mt_gainsChart object.

See Also

gainsChart, datatable

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
# pull in sample scored data frame
x <- modelSampleScored
# filter to validation subset
x <- x[x$ValidateFlag, ]
# gains chart binary
y <- gainsChart(x$TargetFlag, x$pTargetFlag)
gainsChartDT(y)
# gains chart continuous
y <- gainsChart(x[x$TargetFlag, "TargetValue"], x[x$TargetFlag, "pTargetValue"])
gainsChartDT(y)
# gains chart combined
y <- gainsChart(x$TargetFlag, x$pTargetFlag*x$pTargetValue, x$TargetValue)
gainsChartDT(y)

dnegrey/miscTools documentation built on Sept. 19, 2017, 12:15 a.m.