latticist: A Lattice GUI

Description Usage Arguments Details Value Author(s) References See Also Examples

View source: R/latticist.R

Description

Interactively explore a data set using Lattice displays.

Usage

1
2
3
4
5
latticist(dat,
          spec = list(),
          reorder.levels = !is.table(dat),
          ...,
          use.playwith = latticist.getOption("use.playwith"))

Arguments

dat

a data frame (with numeric and/or categorical variables), or 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. This is recommended for effective graphic displays. Factor variables of class ordered are not reordered. Therefore you should ensure that any variables whose levels have an inherent order are of class ordered: see as.ordered. Note: the result of cut is by default NOT ordered! In addition, numeric variables with discrete values in (0, 1, -1) are converted to factors.

use.playwith

whether to launch as a toolbar for playwith (requires the playwith package), or a generic gWidgets interface.

...

further arguments specific to the interface type. For the playwith interface, these are passed to playwith. For the gWidgets interface, these are:

width = 450, height = 450

size of the graphics device in pixels. Note, these are ignored if not using an embedded device.

pointsize = 12

text size on the graphics device.

Details

Latticist is a graphical user interface for exploratory visualisation. It is primarily an interface to the Lattice graphics system (from the lattice package), but also produces displays from the vcd package for categorical data.

Given a multivariate dataset (either a data frame or a table), Latticist attempts to produce useful displays based on the properties of the data. The user chooses variables or expressions for the plot axes, for grouping, conditioning and subsetting. Some hypervariate displays are also available.

A minimal graphical user interface is available, built on the gWidgets package. This requires one of the "toolkit implementations" to installed: gWidgetstcltk, gWidgetsRGtk2 or gWidgetsrJava. Note that gWidgetsrJava is currently broken (as of version 0.0-13).

The fastest way to start, without any external system requirements, is to install.packages("gWidgetstcltk"). However, that does not support an embedded graphics device, so the plots will appear in a separate window.

Alternatively, Latticist can be run as a toolbar extension to playwith. This brings many extra features, such as dynamic zooming, identifying data points, linked brushing, etc. Note that the playwith package requires RGtk2 and, therefore, the GTK+ libraries.

To enable all types of graphic displays, install the hexbin and deldir packages.

Value

The playwith method invisibly returns the playState object representing the plot window. One can close it with playDevOff() or dev.off().

The gWidgets method invisibly returns the gwindow object. One can close it with dispose().

Author(s)

Felix Andrews felix@nfrac.org

References

For an excellent introduction to and coverage of Lattice:

Sarkar, Deepayan (2008) “Lattice: Multivariate Data Visualization with R”, Springer. ISBN: 978-0-387-75968-5 http://lmdvr.r-forge.r-project.org/

The mosaic displays and extensions from vcd are well described in:

David Meyer, Achim Zeileis, and Kurt Hornik (2006). “The Strucplot Framework: Visualizing Multi-Way Contingency Tables with vcd”. Journal of Statistical Software, 17(3), 1-48. http://www.jstatsoft.org/v17/i03/

See Also

latticistCompose, latticist.options, Lattice, lattice.demo in the TeachingDemos package.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
if (interactive()) {
options(device.ask.default = FALSE)

## Not run: 
## data frame example:
latticist(iris)

## table example:
latticist(Titanic, spec = list(groups = "Survived"))

## End(Not run)

## The GUI comes in three flavours:

if (require("gWidgetstcltk") &&
    isTRUE(gconfirm("Show tcl/tk-based GUI?")))
{
   options(guiToolkit = "tcltk")
   latticist(CO2, use.playwith = FALSE)
}

if (require("gWidgetsRGtk2") &&
    isTRUE(gconfirm("Show RGtk2-based GUI?")))
{
   options(guiToolkit = "RGtk2")
   latticist(CO2, use.playwith = FALSE)
}

if (require("playwith") &&
    isTRUE(gconfirm("Show playwith-based GUI?")))
{
   latticist(CO2, use.playwith = TRUE)
}

}

11010tianyi/latticist documentation built on May 5, 2019, 10:36 a.m.