mutate_dummy: Mutate a new set of columns for dummy variable coding of...

View source: R/inla-idx.R

mutate_dummyR Documentation

Mutate a new set of columns for dummy variable coding of 'var'.

Description

The 'var' column is a categorical variable which may be expressed in terms of 'length(unique(df$var))' columns with levels zero or one using 'model.matrix'.

Usage

mutate_dummy(df, var)

Arguments

df

A dataframe.

var

A categorical variable in 'df'.

Value

A dataframe with additional columns for the dummy variables.


athowes/multi.utils documentation built on July 20, 2024, 10:57 p.m.