Description Usage Arguments Details Value Author(s) References See Also Examples
~~ A concise (1-5 lines) description of what the function does. ~~
1 | main.panel.cm(x, y, tol = 0.05, cex = 1)
|
x |
~~Describe |
y |
~~Describe |
tol |
~~Describe |
cex |
~~Describe |
~~ If necessary, more details than the description above ~~
~Describe the value returned If it is a LIST, use
comp1 |
Description of 'comp1' |
comp2 |
Description of 'comp2' |
...
~~who you are~~
~put references to the literature/web site here ~
~~objects to See Also as help
, ~~~
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(x, y, tol = 0.05, cex = 1)
{
# panel for upper off diagonal panels
grid.points(x, y, pch = 16, gp=gpar(col=grey(0.35), cex=0.2*cex))
# fit a linear model to the data
lm1 <- lm(y ~ x)
x1 <- 0:20/20
fit <- suppressWarnings(predict.lm(lm1, newdata=data.frame(x=x1), se.fit=T))
y1 <- fit$fit
yu <- y1 + 2*fit$se
yl <- y1 - 2*fit$se
sig <- identical(anova(lm1)$"Pr(>F)"[1] < tol, T)
if (sig) {
line.f <- list(lwd=3*cex, lty=1, col="#000000")
line.ci <- list(lwd=2*cex, lty=1, col="red4")
} else {
line.f <- list(lwd=cex, lty=1, col="#0000FF")
line.ci <- list(lwd=cex, lty=2, col="#0000FF")
}
panel.lines(x1,y1, lwd=line.f$lwd, lty=line.f$lty, col=line.f$col)
panel.lines(x1,yu, lwd=line.ci$lwd, lty=line.ci$lty, col=line.ci$col)
panel.lines(x1,yl, lwd=line.ci$lwd, lty=line.ci$lty, col=line.ci$col)
}
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.