Learn R Programming

mosaic (version 0.9-0)

mplot: Generic plotting

Description

Generic function plotting for R objects. Currently plots exist for data.frames, lms, (including glms).

Usage

mplot(object, ...)

## S3 method for class 'lm': mplot(object, which = c(1:3, 7), system = c("lattice", "ggplot2", "base"), ask = FALSE, multiplot = "package:gridExtra" %in% search(), par.settings = theme.mosaic(), level = 0.95, title = paste("model: ", deparse(object$call), "\n"), ...)

## S3 method for class 'data.frame': mplot(object, default = plotTypes, system = c("lattice", "ggplot2"), show = FALSE, title = "", ...)

## S3 method for class 'summary.lm': mplot(object, system = c("lattice", "ggplot2"), level = 0.95, par.settings = trellis.par.get(), ...)

## S3 method for class 'TukeyHSD': mplot(object, system = c("lattice", "ggplot2"), ylab = "", xlab = "difference in means", title = "Tukey's Honest Significant Differences", par.settings = trellis.par.get(), ...)

## S3 method for class 'TukeyHSD': mplot(object, system = c("lattice", "ggplot2"), ylab = "", xlab = "difference in means", title = "Tukey's Honest Significant Differences", par.settings = trellis.par.get(), ...)

Arguments

object
an R object from which a plot will be constructed.
data
a data frame containing the variables that might be used in the plot. Note that for maps, the data frame must contain coordinates of the polygons comprising the map and a variable for determining which corodiantes are part of the same region. See <
default
default type of plot to create; one of "scatter", "jitter", "boxplot", "violin", "histogram", "density", "frequency polygon", "xyplot", or "map"<
system
which graphics system to use (initially) for plotting (ggplot2 or lattice). A check box will allow on the fly change of plotting system.
show
a logical, if TRUE, the code will be displayed each time the plot is changed.
which
a numeric vector used to select from 7 potential plots
ask
if TRUE, each plot will be displayed separately after the user responds to a prompt.
multiplot
if TRUE and ask == FALSE, all plots will be displayed together.
title
title for plot
...
additional arguments. If object is an lm, subsets of these arguments are passed to grid.arrange and to the lattice plotting routines; in particular, nrow and ncol can be used to
level
a confidence level
par.settings
lattice theme settings
xlab
label for x-axis
ylab
label for y-axis

Value

  • Nothing. Just for side effects.

Examples

Run this code
mplot( lm( width ~ length + sex, data=KidsFeet) )
mplot( HELPrct )
mplot( HELPrct, "histogram" )
mplot(summary(lm(width ~ length * sex, data=KidsFeet)))
mplot(TukeyHSD( lm(age ~ substance, data=HELPrct) ) )
mplot(TukeyHSD( lm(age ~ substance, data=HELPrct) ), system="ggplot2" )
mplot(TukeyHSD( lm(age ~ substance, data=HELPrct) ) )
mplot(TukeyHSD( lm(age ~ substance, data=HELPrct) ), system="ggplot2" )

Run the code above in your browser using DataLab