dummify: Create dummy variables for categorical (nominal or ordinal)...

View source: R/deepDummy.r

dummifyR Documentation

Create dummy variables for categorical (nominal or ordinal) columns

Description

Create dummy variables for categorical (nominal or ordinal) columns

Usage

dummify(
  dataset,
  columns = NULL,
  remove_level = c("first", "last", "most", "least", "none"),
  effectcoding = FALSE,
  remove_columns = FALSE
)

Arguments

dataset

A data set with factor and/or character variables.

columns

The names or indices of the columns for which dummy variables are to be created; if NULL (default), all corresponding columns are encoded.

remove_level

Controls which level of a factor or character variable is removed.
first removes the first level.
last removes the last level.
most removes the level with the most occurrences within the samples.
least removes the level with the least occurrences within the samples.
none removes none of the levels.

effectcoding

Instead of using default 0/1 value pairs for dummy variables, effectcoding allows to set -1/1 pairs.

remove_columns

A logical value indicating whether the factor/character variables should be removed from dataset after they have been encoded in dummy variables.

Value

The dataset with encoded dummy variables.

See Also

effectcoding, append_rows.

Other Dummifying: append_rows(), dummify_multilabel(), effectcoding(), one_hot_decode(), one_hot_encode(), remove_columns(), resample_imbalanced(), sparse_encode()


stschn/deepANN documentation built on June 25, 2024, 7:27 a.m.