[R] ellipse in pairs plot

From: Kaveh Vakili <kaveh.vakili_at_ulb.ac.be>
Date: Fri, 14 Nov 2008 02:01:00 +0100 (CET)

Hi dear list,

I'm scrambling with this:

i have a p-dimensional data frame for which i want to have a pairs() plot, with ellipse added in each lower.panel.

I want the ellipse's parameter (mu, sigma) to be extracted from the appropriate entries in a pre-computed matrix ("dab" in the code below).

Can it be done ?

Thanks in advance,

melly<-function (x, y, col = par("col"), bg = NA, pch = par("pch"),cex = 1){

    points(x, y, pch = pch, col = col, bg = bg, cex = cex)     ok <- is.finite(x) & is.finite(y)
    if (any(ok))

        ellipse(mu=dab$center[?],sigma=dab$cov[?,?]) }

pairs(wf[,1:5],diag.panel=bagwag,col=wc,pch=wp,cex=.5,lower.panel=melly)



R-help_at_r-project.org mailing list

https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. Received on Fri 14 Nov 2008 - 07:05:27 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Fri 14 Nov 2008 - 07:30:24 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.

list of date sections of archive