1 |
x |
|
y |
|
split.val |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 | ##---- Should be DIRECTLY executable !! ----
##-- ==> Define data, use random,
##-- or do help(data=index) for the standard data sets.
## The function is currently defined as
function (x, y, split.val = NULL)
{
if (!is.data.frame(x))
x = as.matrix(x)
if (is.null(split.val)) {
v = idealf(y)
flag1 = (y <= v$ql)
flag2 = (y >= v$qu)
}
if (!is.null(split.val)) {
flag1 = (y <= split.val[1])
flag2 = (y >= split.val[2])
}
flag3 = as.logical(as.numeric(!flag1) * as.numeric(!flag2))
d1 = x[flag1, ]
d2 = x[flag2, ]
d3 = x[flag3, ]
list(lower = d1, middle = d3, upper = d2)
}
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.