Learn R Programming

playwith (version 0.9-11)

latticist: A Lattice GUI

Description

Interactively visualise a data set using Lattice displays.

Usage

latticist(dat,
          reorder.levels = TRUE,
          plot.call = quote(marginals(dat, reorder=FALSE)),
          ...,
          labels = rownames(dat),
          time.mode = FALSE)

Arguments

dat
a data frame containing numeric and/or categorical variables.
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. Th
plot.call
call defining the initial plot display.
..., labels, time.mode
further arguments passed to playwith.

Value

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

Details

Just try it... It is recommended to install hexbin, which is a BioConductor package, as follows: source("http://bioconductor.org/biocLite.R") biocLite("hexbin") To change the style of lattice graphics, use lattice.options(default.theme=...). See show.settings, simpleTheme and custom.theme.

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

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.
## Try: uptake ~ conc
##      uptake ~ conc | Plant
##      uptake ~ conc | Type, groups = Treatment
latticist(CO2)

## National Health and Nutrition Examination Survey.
## Try: ~ Smoke, groups = Sex
##      Sex ~ Smoke
##      Smoke ~ Age | Sex
##      ~ Diet.Iron, groups = Sex
##      Hemoglobin ~ Diet.Iron | Sex
##      (with both x and y "discretized")
if (require(hexbin)) {
  readline("Hit Enter for 'NHANES' example...")
  data(NHANES)
  latticist(NHANES)
}

## audit dataset: artificial data representing tax work.
if (require(rattle)) {
  readline("Hit Enter for 'audit' example...")
  audit <- read.csv(system.file("csv", "audit.csv",
                    package = "rattle"))
  latticist(audit, new = TRUE)
}

}

Run the code above in your browser using DataLab