Description Usage Arguments Examples
Produce distance to model - error plot for applicability domain studies
1 | cinf_plot_d2m_error(y_err, d2m, mean_parts = TRUE, nparts = 3, color_parts = "red", ...)
|
y_err |
|
d2m |
|
mean_parts |
|
nparts |
|
color_parts |
|
... |
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 | ##---- 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 (y_err, d2m, mean_parts = TRUE, nparts = 3, color_parts = "red",
...)
{
npoints <- length(y_err)
oldnum <- order(d2m)
y_err <- y_err[oldnum]
d2m <- d2m[oldnum]
plot(d2m, y_err, main = "Distance to Model - Error Plot",
xlab = "Distance to model", ylab = "Error")
if (mean_parts) {
p_first <- integer(nparts)
p_last <- integer(nparts)
p_size <- floor(npoints/nparts)
for (ip in 1:nparts) p_first[ip] <- (ip - 1) * p_size +
1
if (nparts > 1)
for (ip in 1:(nparts - 1)) p_last[ip] <- p_first[ip] +
p_size
p_last[nparts] <- npoints
p_mean <- integer(nparts)
for (ip in 1:nparts) p_mean[ip] <- mean(y_err[p_first[ip]:p_last[ip]])
for (ip in 1:nparts) {
x <- c(d2m[p_first[ip]], d2m[p_last[ip]])
y <- c(p_mean[ip], p_mean[ip])
lines(list(x = x, y = y), col = color_parts)
}
}
}
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.