barchart.table

0th

Percentile

table methods for barchart and dotplot

Contingency tables are often displayed using barcharts and dotplots. These methods are provided for convenience and operate directly on tables. Arrays and matrices are simply coerced to be a table.

Keywords
hplot
Usage
## S3 method for class 'table':
barchart(x, data, groups = TRUE,
         origin = 0, stack = TRUE, \dots, horizontal = TRUE)

## S3 method for class 'array': barchart(x, data, \dots)

## S3 method for class 'matrix': barchart(x, data, \dots)

## S3 method for class 'table': dotplot(x, data, groups = TRUE, \dots)

## S3 method for class 'array': dotplot(x, data, \dots)

## S3 method for class 'matrix': dotplot(x, data, \dots)

Details

The first dimension is used as the variable on the vertical axis. The last dimension is optionally used as a grouping variable (to produce stacked barcharts by default). All other dimensions are used as conditioning variables. The order of these variables cannot be altered (except by permuting the original argument using t or aperm). For more flexibility, use the formula method after converting the table to a data frame using the relevant as.data.frame method.

Value

An object of class "trellis". The update method can be used to update components of the object and the print method (usually called by default) will plot it on an appropriate plotting device.

See Also

barchart, t, aperm, table, panel.barchart, Lattice

Aliases
Examples
barchart(Titanic, scales = list(x = "free"),
         auto.key = list(title = "Survived"))
Documentation reproduced from package lattice, version 0.17-10, License: GPL (>= 2)

Community examples

Looks like there are no examples yet.