1 |
x1 |
|
x2 |
|
x3 |
|
x4 |
|
x5 |
|
fr |
|
aval |
|
xlab |
|
ylab |
|
color |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 | ##---- 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 (x1, x2, x3 = NULL, x4 = NULL, x5 = NULL, fr = 0.8,
aval = 0.5, xlab = "X", ylab = "", color = rep("black", 5))
{
if (is.matrix(x1) || is.data.frame(x1))
x1 = listm(x1)
if (is.list(x1)) {
x = x1
J = length(x)
ic = 0
for (j in 1:J) {
ic = ic + 1
if (ic == 1)
x1 = x[[1]]
if (ic == 2)
x2 = x[[2]]
if (ic == 3)
x3 = x[[3]]
if (ic == 4)
x4 = x[[4]]
if (ic == 5)
x5 = x[[5]]
}
}
x1 <- elimna(x1)
x2 <- elimna(x2)
x1 <- sort(x1)
x2 <- sort(x2)
if (!is.null(x3))
x3 <- sort(x3)
if (!is.null(x4))
x4 <- sort(x4)
if (!is.null(x5))
x5 <- sort(x5)
z3 = NULL
z4 = NULL
z5 = NULL
z1 <- akerd(x1, aval = aval, fr = fr, pyhat = TRUE, plotit = FALSE)
z2 <- akerd(x2, aval = aval, fr = fr, pyhat = TRUE, plotit = FALSE)
if (!is.null(x3))
z3 = akerd(x3, aval = aval, fr = fr, pyhat = TRUE, plotit = FALSE)
if (!is.null(x4))
z4 = akerd(x4, aval = aval, fr = fr, pyhat = TRUE, plotit = FALSE)
if (!is.null(x5))
z5 = akerd(x5, aval = aval, fr = fr, pyhat = TRUE, plotit = FALSE)
plot(c(x1, x2, x3, x4, x5), c(z1, z2, z3, z4, z5), xlab = xlab,
ylab = ylab, type = "n")
lines(x1, z1, col = color[1])
lines(x2, z2, lty = 2, col = color[2])
if (!is.null(x3))
lines(x3, z3, lty = 3, col = color[3])
if (!is.null(x4))
lines(x4, z4, lty = 4, col = color[4])
if (!is.null(x5))
lines(x5, z5, lty = 5, col = color[5])
}
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.