Learn R Programming

AssocBin (version 1.1-2)

depDisplay: Generate a departure display

Description

This is a generic function which generates a departure display to show the dependence between pairs of variables for several common data structures.

Usage

depDisplay(x, y, ..., pair, quants)

# S3 method for default depDisplay(x, y, ..., quants, border)

# S3 method for data.frame depDisplay(x, ..., pair, quants, border)

# S3 method for DepSearch depDisplay(x, ..., pair, quants, border)

Value

Invisibly returns the binning obtained and generates a departure display of the pairwise dependence.

Arguments

x

a `data.frame`, `DepSearch` object, or a vector

y

an optional vector, only used if `x` is a vector

...

additional arguments to pass to plot

pair

the pair of variables to display when `x` is a `data.frame` or an `DepSearch`. If `x` is a `data.frame`, pair can be specified in three ways: as a string with format "<y>:<z>", as a character vector of length two, or as a numeric vector of length two specifying the pair of variables to bin. If `x` is an `DepSearch`, pair must be either a number or a string of the format "<y>:<z>" specifying which binned pair of `x` to display.

quants

list of two named vectors `x` and `y` providing the quantiles to display on the corresponding axis in the case it is a continuous variable. Defaults to the five number summary.

border

string providing the colour of bin borders to draw, NA suppresses borders

Methods (by class)

  • depDisplay(default): Default depDisplay method

  • depDisplay(data.frame): data.frame method for depDisplay

  • depDisplay(DepSearch): DepSearch method for depDisplay

Author

Chris Salahub

Details

depDisplay

`depDisplay` is a wrapper of the `plotBinning` function with defaults set to be informative for most investigations.

Examples

Run this code
x <- rnorm(100)
y <- factor(abs(round(x*2)))
depDisplay(x, y)

## on the iris data
data(iris)
firstPair <- depDisplay(iris, pair = c(1,2))
## another way
firstPair2 <- depDisplay(iris, pair = c("Sepal.Length", "Sepal.Width"))
## a final way
firstPair2 <- depDisplay(iris, pair = "Sepal.Length:Sepal.Width")

Run the code above in your browser using DataLab