solveNonDecreasing | R Documentation |
Return a vector of length y that is a function of x (differs at must where x differs) obeying the same order constraints as x. This vector is picked as close to y (by square-distance) as possible.
solveNonDecreasing(varName, x, y, w = NULL)
varName |
character, name of variable |
x |
numeric, factor, or character input (not empty, no NAs). |
y |
numeric or castable to such (same length as x no NAs), output to match |
w |
numeric positive, same length as x (weights, can be NULL) |
Please see https://github.com/WinVector/vtreat/blob/main/extras/MonotoneCoder.md.
isotonicly adjusted y (non-decreasing)
if(requireNamespace("isotone", quietly = TRUE)) {
solveNonDecreasing('v', 1:3, c(1,2,1))
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.