indexData | R Documentation |
Indexing a Matrix or Data Frame According to Given Indices
indexData(x, indices)
x |
A |
indices |
vector of column indices of |
An object as x
(typically a data.frame
or
matrix
) containing x
indexed by indices
.
Useful for constructing data.frames without .1, .2, ... in their names when indexing a data.frame with a zenpath.
Marius Hofert and Wayne Oldford
zenplot()
which provides the zenplot.
Other tools related to constructing zenpaths:
connect_pairs()
,
extract_pairs()
,
graph_pairs()
,
groupData()
,
zenpath()
## 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.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.