## 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