Learn R Programming

playwith (version 0.9-32)

latticist: A Lattice GUI

Description

Interactively explore a data set using Lattice displays.

Usage

latticist(dat,
          spec = alist(),
          reorder.levels = TRUE,
          ...,
          labels = rownames(dat),
          time.mode = FALSE,
          eval.args = playwith.getOption("eval.args"),
          height = playwith.getOption("height") - 1,
          plot.call)

Arguments

dat
a data frame (with numeric and/or categorical variables), or an object that can be coerced with as.data.frame (such as a table).
spec
a list specifying the initial latticist display. See latticistCompose.
reorder.levels
if TRUE, change the ordering of levels of factor variables so they are in order of frequency. Note that this does not change the data, only its internal representation: see reorder
plot.call
call defining the initial plot display. This can be given instead of dat, and the dataset will be derived from it (see examples).
..., labels, time.mode, eval.args, height
further arguments passed to playwith.

Value

  • invisibly returns the playState object representing the plot window: see playwith.API.

Details

Latticist is an extension to playwith, adding a toolbar to construct lattice displays for a given dataset. As such, many of the features, such as style settings and linked brushing, are (or should be) described in the help for playwith. It is recommended to install the deldir package, as well as hexbin, a BioConductor package, which can be installed as follows: source("http://bioconductor.org/biocLite.R") biocLite("hexbin")

References

For an excellent introduction to and coverage of Lattice: Sarkar, Deepayan (2008) "Lattice: Multivariate Data Visualization with R", Springer. http://lmdvr.r-forge.r-project.org/

See Also

playwith, Lattice, lattice.demo in the TeachingDemos package.

Examples

Run this code
if (interactive()) {
options(device.ask.default = FALSE)

## CO2 dataset: see ?CO2
## From an experiment on the cold tolerance of a grass species.
latticist(CO2)
## The following sequence would normally be interactive:
stopifnot(gconfirm("Press OK for next example..."))
latticist(CO2, spec = alist(yvar = uptake))
stopifnot(gconfirm("Press OK for next example..."))
latticist(CO2, spec = alist(yvar = uptake, xvar = conc))
stopifnot(gconfirm("Press OK for next example..."))
latticist(CO2, spec = alist(yvar = uptake, xvar = conc,
                            groups = Treatment))
stopifnot(gconfirm("Press OK for next example..."))
latticist(CO2, spec = alist(yvar = uptake, xvar = conc,
                            groups = Treatment, cond = Type))
stopifnot(gconfirm("Press OK for next example..."))
latticist(CO2, spec = alist(yvar = uptake, xvar = conc,
                            cond = Plant))
stopifnot(gconfirm("Press OK for next example..."))

## environmental dataset: see ?environmental
## Daily measurements related to ozone pollution in NYC 1973.
## Specify initial display:
latticist(plot.call = quote(parallel(environmental, col = 1)),
    click.mode = "Brush")

}

Run the code above in your browser using DataLab