xyloplot: Create a xyloplot

Description Usage Arguments Value See Also

View source: R/functions.R

Description

Plots xylophones (centre-aligned histograms) for the input vector(s), provided either as a single vector or list of vectors. Numeric vectors and factors are admissible (character vectors are transformed to factors). If numeric vectors are provided, cut will be used to aggregate values, whereas if character vectors or factors are provided, each 'level' will have it's own ‘key’ on the ‘xylophone’. Note that if factors are used, all factors in 'x' must have identical levels.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
xyloplot(x, ...)

## S3 method for class 'list'
xyloplot(x, breaks = NULL, space = 0.1, pivot = if
  (!is.null(names(x))) factor(names(x), levels = names(x)) else
  seq_along(x), pivot_labels = if (is.factor(pivot)) levels(pivot) else
  NULL, just = 0.5, freq = FALSE, ...)

## S3 method for class 'factor'
xyloplot(x, ...)

## S3 method for class 'logical'
xyloplot(x, ...)

## S3 method for class 'character'
xyloplot(x, ...)

## S3 method for class 'numeric'
xyloplot(x, ...)

Arguments

x

Vector or list of vectors to use for creating xyloplots.

...

Additional arguments passed to xyloplot.list, or other graphical parameters (e.g. "col", "lwd", ..., etc.) for xyloplot.list which are recycled along the xylophones and then used by functions for rendering the individual rectangles (e.g. rect).

breaks

A single positive integer value giving the number of breakpoints to use for an evenly spaced partition of the values in x, a numeric vector explicitly giving the the breakpoints, or NULL to use the default partition.

space

The proportion of the total distance on the pivots axis allocated to each 'xylophone' which should be empty or NULL, in which case the pivot axis coordinates for the xyloplot rectangles for each pivot are transformed to [0, 1].

pivot

Vector the same length as x used to determine which pivot to place the xylophone representing corresponding distributions of x onto (duplicated values go on the same pivots).

pivot_labels

Character vector giving names for each pivot or NULL.

just

Vector whose elements should take values in 0, 0.5, 1 which determines whether to centre-align the xylophones (0.5, default), left align them (0) or right align them (1).

freq

Logical value. If TRUE, the frequencies/counts of data points falling in each interval are represented. If FALSE (default), the frequency density of data points in each interval are represented.

Value

Returns an object of class "xyloplot" containing the specification of graphical elements required to create a corresponding plot, including the coordinates of the corners of rectangles (in terms of the location on the value value axis and the pivot axis across which the xyloplots are spread) and the positions of the breakpoints used to partition the range of values.

See Also

plot.xyloplot


xyloplot documentation built on April 14, 2020, 7:07 p.m.