plot {IntervalQuestionStat}R Documentation

Plot a single interval or a list of intervals

Description

S4 methods for function plot. As in the generic plot S3 ‘graphics’ method, these methods plot interval-valued data contained in both IntervalData and IntervalList objects.

Usage

## S4 method for signature 'IntervalData,missing'
plot(x, y,
     layout = c("vertical", "horizontal"),
     bounds = FALSE, mid = FALSE,
     ...)

## S4 method for signature 'IntervalData,IntervalData'
plot(x, y, bounds = FALSE, ...)

## S4 method for signature 'IntervalList,missing'
plot(x, y,
     layout = c("vertical", "horizontal"),
     bounds = FALSE, mid = FALSE,
     ...)

## S4 method for signature 'IntervalList,IntervalList'
plot(x, y, bounds = FALSE, ...)

Arguments

x

A single interval or a unique list with several intervals stored as an IntervalData object or as an IntervalList, instance respectively.

y

A single interval or a unique list with several intervals stored as an IntervalData object or as an IntervalList, instance respectively.

layout

The axes along which the intervals should be displayed. Only two alternatives are allowed: vertical (default) and horizontal.

bounds

A single logical value indicating whether the extremes of the given intervals should be plotted or not (default).

mid

A single logical value indicating whether the mid-points of the given intervals should be plotted or not (default).

...

Other graphical parameters.

Details

Note that in order to get bidimensional plots with interval-valued data, x and y arguments must be of the same class, that is, either both are IntervalData objects or either both are IntervalList instances. Moreover, in the second case both lists must have the same number of intervals.

Value

This function does not return any value. It only plots interval-valued data.

Author(s)

José García-García garciagarjose@uniovi.es

Examples

## Some trivial plot() examples for IntervalData objects
i1 <- IntervalData(0, 1)
i2 <- IntervalData(2, 3)
plot(i1)                             ## Plot only an interval vertically
plot(i1, layout = "horizontal")      ## Plot only an interval horizontally
plot(i1, bounds = TRUE, mid = TRUE)  ## Add bounds and remark mid-point
plot(i1, i2)                         ## Plot an interval on each axis 
plot(i1, i2, bounds = TRUE)          ## Add bounds

## Some trivial plot() examples for IntervalList objects
list1 <- IntervalList(c(0, 3, 2, 5, 6), c(4, 5, 4, 8, 7))
list2 <- IntervalList(c(3, 0, 3, 1, 4), c(7, 4, 6, 2, 6))
plot(list1)                            ## Plot an interval list vertically
plot(list1, layout = "horizontal")     ## Plot an interval list horizontally
plot(list1, bounds = TRUE, mid = TRUE) ## Add bounds and remark mid-points
plot(list1, list2)                     ## Plot an interval list on each axis 
plot(list1, list2, bounds = TRUE)      ## Add bounds

## Further plot() customizations
plot(list1, bounds = TRUE, mid = TRUE,
     main = "My one-dimensional interval-valued plot",
     col = c("blue", "red"), lwd = 2)
plot(list1, list2, bounds = TRUE,
     main = "My bidimensional interval-valued plot",
     col = "blue", lwd = 2)

[Package IntervalQuestionStat version 0.2.0 Index]