mPlotting: Interactive plotting

Description Usage Arguments Details Value Examples

Description

These functions provide a menu selection system (via manipulate) so that different aspects of a plot can be selected interactively. The ggplot2 or lattice command for generating the plot currently being displayed can be copied to the console, whence it can be copied to a document for later direct, non-interactive use.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
mPlot(data, format, default = format, system = system_choices()[1],
  show = FALSE, title = "", data_text = expr_text(data), ...)

mMap(data, default = "map", system = "ggplot2", show = FALSE,
  title = title, data_text = expr_text(data), ...)

mScatter(data, default = c("scatter", "jitter", "boxplot", "violin", "line"),
  system = "ggformula", show = FALSE, title = "",
  data_text = lazyeval::expr_text(data))

mUniplot(data, default = c("histogram", "density", "frequency polygon",
  "ASH plot"), system = system_choices()[1], show = FALSE, title = "",
  data_text = expr_text(data))

Arguments

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 coordinates are part of the same region. See sp2df() for one way to create such a data frame. Typically merge() will be used to combine the map data with some auxilliary data to be displayed as fill color on the map, although this is not necessary if all one wants is a map.

format

a synonym for default.

default

default type of plot to create; one of "scatter", "jitter", "boxplot", "violin", "histogram", "density", "frequency polygon", "xyplot", or "map". Unique prefixes suffice.

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.

title

a title for the plot

data_text

A text string describing the data. It must be possible to recover the data from this string using eval(). Typically users will not need to modify this from the default value.

...

additional arguments

Details

Only mPlot is required by end users. The other plotting functions are dispatched based on the value of default. Furthermore, mplot() will dispatch mPlot when provided a data frame.

Currently maps are only supported in ggplot2 and not in lattice.

Value

Nothing. Just for side effects.

Examples

1
2
3
4
5
## Not run: 
mPlot(HELPrct, format = "scatter")
mPlot(HELPrct, format = "density")

## End(Not run)

mosaic documentation built on Nov. 28, 2017, 5:02 p.m.