Description Usage Arguments Value
Convert Values of Indicators to utility-values.
1 2 3 | utilityfunc(x, type, x1 = 0, y1 = switch(as.character(type), prop = 0,
negprop = 200, antiprop = 200, 0), x2 = calculatecenterfunc("mean", x,
offset = 0), y2 = 100, replace_NA = TRUE)
|
x |
Numeric. Value to be converted. |
type |
One of c("prop", "negprop", antiprop", "identity") |
x1 |
if (replace_NA=TRUE & is.na(x1)): 0 |
y1 |
if (replace_NA=TRUE & is.na(y1)): switch(as.character(type),prop=0,negprop=200,antiprop=200,0) |
x2 |
if (replace_NA=TRUE & is.na(x2)): calculatecenterfunc("mean", x,offset=0) |
y2 |
if (replace_NA=TRUE & is.na(y2)): 100 |
replace_NA |
should NA be replaced at x1,y1,x2,y2 ?? |
switch(as.character(type), prop = scale* (x+offset)/centervalue , negprop = 2*scale - scale*(x +offset)/centervalue , antiprop=scale* centervalue/(x+offset), identity= x)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.