Learn R Programming

eha (version 2.4-4)

cro: Creates a minimal representation of a data frame.

Description

Given a data frame with a defined response variable, this function creates a unique representation of the covariates in the data frame, vector (matrix) of responses, and a pointer vector, connecting the responses with the corresponding covariates.

Usage

cro(dat, response=1)

Arguments

dat
A data frame
response
The column(s) where the response resides.

Value

A list with components

Details

The rows in the data frame are converted to text strings with paste and compared with match.

See Also

match, paste

Examples

Run this code
dat <- data.frame(y = c(1.1, 2.3, 0.7), x1 = c(1, 0, 1), x2 = c(0, 1, 0))
cro(dat)

Run the code above in your browser using DataLab