Learn R Programming

mosaic (version 0.5-1)

plotPoints: Scatter plot of points

Description

Make or add a scatter plot in a manner coordinated with plotFun.

Usage

plotPoints(x, data = parent.frame(), add = FALSE,
    panelfun = panel.xyplot, plotfun = xyplot, ...)

Arguments

x
A formula specifying y ~ x or z ~ x&y
data
Data frame containing the variables to be plotted. If not specified, the variables will be looked up in the local environment
add
If TRUE, overlay the scatter plot on the current plot.
panelfun
Lattice panel function to be used for adding. Set only if you want something other than a scatter plot. Mainly, this is intended to add new functionality through other functions.
plotfun
Lattice function to be used for initial plot creation. Set only if you want something other than a scatter plot. Mainly, this is intended to add new functionality through other functions.
...
additional arguments

Value

  • A lattice graphics object (if add=FALSE)

See Also

plotFun

Examples

Run this code
plotPoints( width ~ length, data=KidsFeet, groups=sex, pch=20)
f <- makeFun( lm( width ~ poly(length,2) * sex, data=KidsFeet))
plotFun( f(length=length,sex="G")~length, add=TRUE, col="pink")
plotFun( f(length=length,sex="B")~length, add=TRUE)

Run the code above in your browser using DataLab