Learn R Programming

zenplots (version 1.0.6)

indexData: Indexing a Matrix or Data Frame According to Given Indices

Description

Indexing a Matrix or Data Frame According to Given Indices

Usage

indexData(x, indices)

Value

An object as x

(typically a data.frame or

matrix) containing x

indexed by indices.

Arguments

x

A matrix or data.frame (most useful for the latter).

indices

vector of column indices of x (typically obtained from zenpath()).

Author

Marius Hofert and Wayne Oldford

See Also

zenplot() which provides the zenplot.

Other tools related to constructing zenpaths: connect_pairs(), extract_pairs(), graph_pairs(), groupData(), zenpath()

Examples

Run this code
## The function is handiest for data frames
## where we want to reuse the variable names
## without adding a suffix like ".1" etc.
## For example,
x <-  BOD  # Biochemical Oxygen Demand data in base R
indices <- rep(1:2, 2)
## now compare
indexData(x, indices)
## to
x[, indices]
## zenplots prefer not to have the suffixes.

Run the code above in your browser using DataLab