1 | rd2plot(x, y, fr = 0.8, xlab = "", ylab = "")
|
x |
|
y |
|
fr |
|
xlab |
|
ylab |
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 | ##---- 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, fr = 0.8, xlab = "", ylab = "")
{
x <- elimna(x)
y <- elimna(y)
rmdx <- NA
rmdy <- NA
for (i in 1:length(x)) {
rmdx[i] <- sum(near(x, x[i], fr))
}
for (i in 1:length(y)) {
rmdy[i] <- sum(near(y, y[i], fr))
}
rmdx <- rmdx/length(x)
rmdy <- rmdy/length(y)
plot(c(x, y), c(rmdx, rmdy), type = "n", ylab = ylab, xlab = xlab)
sx <- sort(x)
xorder <- order(x)
sysm <- rmdx[xorder]
lines(sx, sysm)
sy <- sort(y)
yorder <- order(y)
sysm <- rmdy[yorder]
lines(sy, sysm, lty = 2)
}
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.