mpone {dae}R Documentation

Converts the first two levels of a factor into the numeric values -1 and +1.

Description

Converts the first two levels of a factor into the numeric values -1 and +1.

Usage

mpone(factor)

Arguments

factor The factor to be converted.

Value

A numeric vector.

Warning

If the factor has more than two levels they will be coerced to numeric values.

See Also

factor

Examples

  mp <- c("-", "+")
        C <- factor(mpone(A)*mpone(B), labels = mp)

[Package dae version 0.4-1 Index]