Skip to content

Instantly share code, notes, and snippets.

@shanmdphd
Last active October 13, 2016 07:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save shanmdphd/765ec9dbed88f1a8a9401b0427855d2f to your computer and use it in GitHub Desktop.
Save shanmdphd/765ec9dbed88f1a8a9401b0427855d2f to your computer and use it in GitHub Desktop.
NONMEM accessaries

Scatter plot matrices (pairs plots)

###### Scatter plot matrices (pairs plots) ######
pairs(d.demog)
#add a loess smoother, type:
pairs(d.demog, panel = panel.smooth)
panel.cor <- function(x, y, digits=2, prefix="", cex.cor)
{
usr <- par("usr"); on.exit(par(usr))
par(usr = c(0, 1, 0, 1))
r = (cor(x, y))
txt <- format(c(r, 0.123456789), digits=digits)[1]
txt <- paste(prefix, txt, sep="")
if(missing(cex.cor)) cex <- 1.5
text(0.5, 0.5, txt, cex = 1.5)
}
pairs(d.demog, lower.panel=panel.smooth, upper.panel=panel.cor)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment