correct_model_levels {vvsculptor}R Documentation

Correct model levels

Description

Correct level names for modelling and in the use of ROC curve/AUC.

Usage

correct_model_levels(data)

Arguments

data

String with level names.

Value

Corrected level names.

Examples

  data <- data.frame(id = c(1,2,3),
                 name = c("Alice","Bob","Charlie"),
                 gender = factor(c("Female","Male","Female"), levels = c("Female","Male")))

  correct_model_levels(data)
  # returns a data frame with factor levels of the variable gender corrected to "Female" and "Male"

  data <- data.frame(id = c(1,2,3),
                 name = c("Alice","Bob","Charlie"),
                 gender = factor(c("Female","Male","Female")))
  correct_model_levels(data)
  # returns a data frame with factor levels of the variable gender corrected to "F" and "M"

[Package vvsculptor version 0.4.10 Index]