[R] Scatter plots using pairs()
David Winsemius
dwinsemius at comcast.net
Wed Feb 12 03:12:53 CET 2014
On Feb 11, 2014, at 12:54 PM, Nestor Arguea wrote:
> Command pairs() does not show the correlation coefficient on the upper
> diagonal of a set of scatter plots. The command produces an error in
> Windows 7, but it works fine in OS X Mavericks with the same R version
> 3.0.2. Platform, R version and example under Windows 7 provided
> below.
> $platform
> [1] "i386-w64-mingw32"
> ...
> $version.string
> [1] "R version 3.0.2 (2013-09-25)"
>
> Example:
>
>> set.seed(12345)
>> x <- rnorm(10)
>> y <- log(c(2:11))
>> z <- data.frame(x,y)
>> cor(z)
> x y
> x 1.0000000 -0.4867929
> y -0.4867929 1.0000000
>> pairs(z)
>> pairs(z,upper.panel=panel.cor)
> Error in pairs.default(z, upper.panel = panel.cor) :
> object 'panel.cor' not found
I suspect you copied more of the example on the help page (where panel.cor is defined) to the Mac than you did to your Windoze device.
>
> Thanks,
>
> Nestor
> --
> Nestor Arguea
> Chair, Marketing and Economics
> Director of International Business Programs
> University of West Florida
David Winsemius
Alameda, CA, USA
More information about the R-help
mailing list