Learn R Programming

extracat (version 1.6-3)

irmb: Interactive Multiple Barchart for relative frequencies and generalized Spineplots

Description

The irmb function is an interactive version of the basic rmb function. It provides sliders for x- and y-scales, variable inclusion/exclusion, axis changes, switching between barcharts, spineplots and mosaic plots as well as model selection for residual shadings and a few more options. It depends on the iWidgets package and therefore only works when called from the JGR console.

Usage

## S3 method for class 'formula':
irmb(formula, data, gap.prop = 0.2,
               gap.mult = 1.5, col = "hcl", col.opt =list(), Z=100, abbrev = FALSE,
               use.na = FALSE, expected = TRUE,  resid.type = "pearson", 
               max.resid.scale = NULL, cut.rs = 7, yaxis = TRUE, min.alpha = 0.1,
               boxes = TRUE, lab.tv = FALSE, varnames = TRUE, lab.cex = 1.2,...)
## S3 method for class 'ftable':
irmb(x , gap.prop = 0.2, gap.mult = 1.5, col = "hcl", col.opt=list(),
			Z=100, abbrev = FALSE, use.na = FALSE, expected = TRUE,
			resid.type = "pearson", max.resid.scale = NULL, cut.rs = 7,
			yaxis = TRUE, min.alpha = 0.1, boxes = TRUE, lab.tv = FALSE,
			varnames = TRUE, lab.cex = 1.2, ...)

Arguments

x
A table either of class table or of class ftable. The arguments formula and data will be omitted.
formula
Either a formula a formula or an formula. If x is a formula it also specifies th
data
The dataset in form of a frequency table (see ftable or subtable or a data.frame. Ignored if x is a table.
gap.prop
The maximum proportion of the total plot width which is used for the gaps.
gap.mult
The incremental multiplier for the gaps of different dimensions. The gaps corresponding to any one variable are gap.mult times larger than those corresponding to the next variable on the same axis.
col
Either a vector defining the colors of the bars or a name specifying a palette: "hsv" and "rgb" for hsv-based rainbow colors, "hcl" for hcl-based rainbow colors (default), "div" or "diverge"
col.opt
Further options for the color palettes. See e.g. rainbow_hcl or rainbow.
Z
The number of intervals for the sliders.
use.na
Logical, specifying whether or not to drop cases with missing entries. If not, a category "N/A" will be created in each variable where missings occur.
expected
If TRUE residual shadings according to loglinear models will be available.
resid.type
"pearson", "deviance", "working", "partial" or "response". The underlying model is a glm poisson model. The mosaicplot option will always use Pearson r
max.resid.scale
If undefined the scale of the residuals will update with the model.
cut.rs
The number of cuttingpoints for the residual scale.
yaxis
If TRUE a vertical axis will be drawn at both sides of the plot. This is recommended when using the y-axis slider.
min.alpha
In case of eqwidth = T alpha blending with respect to the corresponding weight is applied to the background color of the bars. In order to save very sparse combinations from disappearing there is a minimum alpha value.
boxes
Should the labels be surrounded by boxes?
lab.tv
Should the target variable be included in the labeling?
varnames
Should the variable names be shown as labels?
abbrev
If TRUE the labels will automatically be abbreviated (3 characters) using the abbreviate function.
lab.cex
The fontsize multplier.
...
Further arguments. Usually not necessary.

Value

  • No return value.

concept

Interactive Multiple Barchart for relative frequencies and generalized Spineplots

References

Alexander Pilhoefer New approaches in visualization of categorical data: R-package extracat Journal of Statistical Software, submitted March 2010

Examples

Run this code
data(housing)
    # example 1
    irmb(~Type+Infl+Cont+Sat,data=housing,abbrev=4)
    
    # example 2
    irmb(~Type+Infl+Cont+Sat,data=housing,expected = FALSE,
    	gap.mult=2,abbrev=4)

Run the code above in your browser using DataLab