des.line: Plots a desirability function on an existing graph

Description Usage Arguments Details Value See Also Examples

View source: R/des.line.R

Description

Plots any of the desirability functions on top of a graph, usually a histogram or density plot.

Usage

1
des.line(x, des.func, des.args, ...)

Arguments

x

Vector of numeric or integer values.

des.func

Name of the desirability function to plot (in quotes).

des.args

A vector of named arguments for the chosen desirability function.

...

Arguments for the plotting function (e.g. xlim, lwd, lty).

Details

This function can be used to visualise how the desirabilities are mapped from the raw data to a 0-1 scale, which can help select suitable cut points. The scale of the y-axis has a minimum of 0 and a maximum of 1.

WARNING: If you set xlim values for the histogram or density plot, then you must pass the same xlim values to des.line; otherwise the data and desirability function (plotted line) will be misaligned. If xlim is not set, then the same default values will be used for the data and the function.

Value

Plotted values of the desirability function.

See Also

d.low, d.high, d.central, d.ends, d.4pl

Examples

1
2
3
4
5
6
set.seed(1)
x1 <- rnorm(100, 10, 2)
hist(x1, breaks=10)
des.line(x1, "d.high", des.args=c(cut1=10, cut2=11))
des.line(x1, "d.high", des.args=c(cut1=10, cut2=11,
des.min=0.1, scale=0.5))

Example output



desiR documentation built on April 17, 2021, 1:07 a.m.