vec2ind: Transform a Vector into an Indicator Matrix

Description Usage Arguments Details Value

View source: R/svs.r

Description

A helper function for transforming a vector into an indicator matrix.

Usage

1
vec2ind(x, add_names = TRUE)

Arguments

x

A vector (which will be converted to a factor).

add_names

Logical specifying whether to add dimnames to the resulting indicator matrix.

Details

This is essentially the function class.ind from the package MASS.

Value

An indicator matrix.


svs documentation built on May 29, 2017, 10:25 a.m.

Search within the svs package
Search all R packages, documentation and source code