Learn R Programming

rapport (version 0.51)

rp.barplot: Barplot

Description

This function is a wrapper around barchart which operates only on factors with optional facet.

Usage

rp.barplot(x, facet = NULL, data = NULL, groups = FALSE,
    percent = FALSE, horizontal = TRUE, ...)

Arguments

x
a numeric variable
facet
an optional categorical variable to make facets by
data
an optional data frame from which the variables should be taken
groups
see xyplot
percent
an option to show percentages (100 category) instead of number of cases. Handy with groups=TRUE. Default value: FALSE without groups, TRUE with groups.
horizontal
see xyplot
...
additional parameters to barchart

Examples

Run this code
rp.barplot(ius2008$game)
rp.barplot(ius2008$game, horizontal = FALSE)
rp.barplot(ius2008$game, facet = ius2008$gender)
rp.barplot(ius2008$game, facet = ius2008$dwell, horizontal = FALSE, layout = c(1,3))
rp.barplot(ius2008$game, facet = ius2008$gender, groups = TRUE)
with(ius2008, rp.barplot(game, facet = gender))
rp.barplot(gender, data = ius2008)
rp.barplot(dwell, gender, ius2008)

Run the code above in your browser using DataLab