[R] pairs plot

Ranjan Maitra m|m@|tr@ @end|ng |rom gmx@com
Fri Feb 7 05:30:25 CET 2025


Bert,

Thanks very much!

Oops! I can not believe I completely  missed this!

Best wishes,
Ranjan



On Thu Feb06'25 08:15:45AM, Bert Gunter wrote:
> From: Bert Gunter <bgunter.4567 using gmail.com>
> Date: Thu, 6 Feb 2025 08:15:45 -0800
> To: Ranjan Maitra <mlmaitra using gmx.com>
> Cc: R-Help <r-help using r-project.org>
> Subject: Re: [R] pairs plot
>
> Possibly because:
> panel.hist is not an existing R function -- you have to first create
> it so pairs() can use it. ?pairs shows you how in the Help examples,
> i.e.
>
> panel.hist <- function(x, ...)
> {
>     usr <- par("usr")
>     par(usr = c(usr[1:2], 0, 1.5) )
>     h <- hist(x, plot = FALSE)
>     breaks <- h$breaks; nB <- length(breaks)
>     y <- h$counts; y <- y/max(y)
>     rect(breaks[-nB], 0, breaks[-1], y, col = "cyan", ...)
> }
>
> Cheers,
> Bert
>
>
> On Thu, Feb 6, 2025 at 8:01 AM Ranjan Maitra via R-help
> <r-help using r-project.org> wrote:
> >
> > According to the help for pairs, the diag.panel function is supposed to
> > take a panel.hist as in:
> >
> >  pairs(USJudgeRatings[1:5], panel = panel.smooth,
> >            cex = 1.5, pch = 24, bg = "light blue", horOdd=TRUE,
> >            diag.panel = panel.hist, cex.labels = 2, font.labels = 2)
> >
> > Error: object 'panel.hist' not found
> >
> > I know that this used to work in the past so I wonder if this was changed and the documentation was not corrected.
> > Anyway, what is the current way of doing this?
> >
> > Many thanks and best wishes,
> > Ranjan
> >
> > ______________________________________________
> > R-help using r-project.org mailing list -- To UNSUBSCRIBE and more, see
> > https://stat.ethz.ch/mailman/listinfo/r-help
> > PLEASE do read the posting guide https://www.R-project.org/posting-guide.html
> > and provide commented, minimal, self-contained, reproducible code.
>
> ______________________________________________
> R-help using r-project.org mailing list -- To UNSUBSCRIBE and more, see
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide https://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.



More information about the R-help mailing list