An example of a useful panel function for huge datasets
Usage
ipanel.smooth(x, y = NULL, pixs = 1, zmax = NULL,
ztransf = function(x) {x},
colramp = IDPcolorRamp, col = "black", lwd = 2,
span = 2/3, iter = 3, ...)
Arguments
x,y
Numeric vectors of the same length.
pixs
Size of pixel in x- and y-direction in [mm] on the
plotting device. When x and y are numeric, pixels are square. When x
and y are factors, pixels are no longer square. The pixels are
enlarged in x-direction.
zmax
Maximum number of counts per Pixel in the plot. When
NULL, the density in the scatter plot is encoded from 0 pixel to
maximum number of counts observed. zmax must be equal or larger than
maximum number of counts found.
ztransf
Function to transform the number of counts per pixel,
which will be mapped by the function in colramp to well
defined colors. The user has to make sure that the transformed
density lies in the range [0,zmax], where zmax is any positive
number (>=2). For examples see ipairs and
ilagplot.
colramp
Color ramp to encode the number of counts within
a pixel by color.
col,lwd
Color and line width of the “smoothed curve”.
span
the smoother span. This gives the proportion of points in
the plot which influence the smooth at each value. Larger values
give more smoothness.
iter
The number of robustifying iterations which should be
performed. Using smaller values of iter will make lowess run
faster.
...
Other graphical parameters as arguments to the
lines function.
Author(s)
Rene Locher
See Also
lowess
Examples
r.lm <- lm(Sepal.Length~Sepal.Width+Petal.Length+Petal.Width+Species,
data=iris)
par(mfrow=c(2,2),pty="s")
itermplot(r.lm, se = TRUE, partial.res=TRUE, smooth=ipanel.smooth,
lwd.smth = 3, pixs = 2, ask=FALSE)
if (require(SwissAir)) {
par(mfrow=c(1,1))
dat <- AirQual[,c("ad.O3","ad.NOx","ad.T","ad.Td","ad.WS")]
dat$ad.O3 <- log(dat$ad.O3)
dat$ad.NOx <- log(dat$ad.NOx)
dat$ad.WS <- log(dat$ad.WS)
pairs(dat,
panel=ipanel.smooth)
} else print("Package SwissAir is not available")
Results
R version 3.3.1 (2016-06-21) -- "Bug in Your Hair"
Copyright (C) 2016 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)
R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.
R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.
Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.
> library(IDPmisc)
Loading required package: grid
Loading required package: lattice
> png(filename="/home/ddbj/snapshot/RGM3/R_CC/result/IDPmisc/ipanel.smooth.Rd_%03d_medium.png", width=480, height=480)
> ### Name: ipanel.smooth
> ### Title: Panelplot for itermplot
> ### Aliases: ipanel.smooth
> ### Keywords: hplot
>
> ### ** Examples
>
> r.lm <- lm(Sepal.Length~Sepal.Width+Petal.Length+Petal.Width+Species,
+ data=iris)
> par(mfrow=c(2,2),pty="s")
> itermplot(r.lm, se = TRUE, partial.res=TRUE, smooth=ipanel.smooth,
+ lwd.smth = 3, pixs = 2, ask=FALSE)
>
> if (require(SwissAir)) {
+ par(mfrow=c(1,1))
+ dat <- AirQual[,c("ad.O3","ad.NOx","ad.T","ad.Td","ad.WS")]
+ dat$ad.O3 <- log(dat$ad.O3)
+ dat$ad.NOx <- log(dat$ad.NOx)
+ dat$ad.WS <- log(dat$ad.WS)
+ pairs(dat,
+ panel=ipanel.smooth)
+ } else print("Package SwissAir is not available")
Loading required package: SwissAir
>
>
>
>
>
>
> dev.off()
null device
1
>