Learn R Programming

IDPmisc (version 0.9.3)

ipanel.smooth: Panelplot for itermplot

Description

An example of a simple useful panel function to be used as argument in itermplot

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
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.

See Also

lowess

Examples

Run this code
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)) {
  data(AirQual)
  r.lm <- lm(log(ad.O3)~log(ad.NOx)+ad.T+ad.Td+ad.WS, data=AirQual)
  par(mfrow=c(2,2),pty="s")
  itermplot(r.lm, se = TRUE, partial.res=TRUE, smooth=ipanel.smooth,
            lwd.smth = 3, pixs = 1, ask=FALSE)
} else print("Package SwissAir is not available")

Run the code above in your browser using DataLab