Description Usage Arguments Value See Also Examples
View source: R/gainsChartBarGraph.R
gainsChartBarGraph
produces a bar graph based on a
mt_gainsChart
object. When two such objects are supplied, the
function produces a combined bar graph, where the first object (xb
) is
labeled as "Build" and the second object (xv
) is labeled as "Validate".
1 2 3 4 |
xb |
|
xv |
|
cb |
character string; fill color for |
cv |
character string; fill color for |
xLabel |
character string; x-axis label |
yLabel |
character string; y-axis label |
yType |
character string; y-axis format type; valid
values are |
yDigits |
non-negative integer value indicating the number of decimal places to show when hovering over the bars |
A plot_ly
visualization of a
mt_gainsChart
object, showing the average Y value (avgY
for "binary"/"continuous"; perFreqYC
for "combined") by quantile (
yhatBin
).
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 | # pull in sample scored data frame
x <- modelSampleScored
# filter to validation subset
x <- split(x, x$ValidateFlag)
# gains chart binary
y <- lapply(x, function(z){gainsChart(z$TargetFlag, z$pTargetFlag)})
# bar graph
gainsChartBarGraph(y[[1]], y[[2]])
# gains chart continuous
y <- lapply(x, function(z){
gainsChart(z[z$TargetFlag, "TargetValue"], z[z$TargetFlag, "pTargetValue"])
})
# bar graph
gainsChartBarGraph(y[[1]], y[[2]])
# gains chart combined
y <- lapply(x, function(z){
gainsChart(z$TargetFlag, z$pTargetFlag*z$pTargetValue, z$TargetValue)
})
# bar graph
gainsChartBarGraph(y[[1]], y[[2]])
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.