Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

dataIndex

Indices of observations in a model data frame


Description

Find sequential indices for observations in a data frame corresponding to the unique combinations of the levels of a given model term from a model object or a data frame

Usage

dataIndex(x, term)

Arguments

x

Either a data frame or a model object

term

The name of one term in the model, consisting only of factors

Value

A vector of indices.

Author(s)

Michael Friendly

Examples

factors <- expand.grid(A=factor(1:3),B=factor(1:2),C=factor(1:2))
n <- nrow(factors)
responses <-data.frame(Y1=10+round(10*rnorm(n)),Y2=10+round(10*rnorm(n)))

test <- data.frame(factors, responses)
mod <- lm(cbind(Y1,Y2) ~ A*B, data=test)

dataIndex(mod, "A")
dataIndex(mod, "A:B")

candisc

Visualizing Generalized Canonical Discriminant and Canonical Correlation Analysis

v0.8-5
GPL (>= 2)
Authors
Michael Friendly [aut, cre], John Fox [aut]
Initial release
2021-01-21

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.