Skip to content

Commit

Permalink
minor additions
Browse files Browse the repository at this point in the history
  • Loading branch information
EdwinKipruto committed Oct 16, 2023
1 parent 679600f commit 8d15350
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions R/transformations.R
Original file line number Diff line number Diff line change
Expand Up @@ -443,6 +443,9 @@ create_dummy_variables <- function(data, var_ordinal = NULL, var_nominal = NULL

# Deal with ordinal variables when provided
if (!is.null(var_ordinal)) {
if (!is.character(var_ordinal))
stop("var_ordinal must be a character name.")

index1 <- which(!var_ordinal %in% xnames)

if (length(index1) != 0)
Expand All @@ -451,6 +454,10 @@ create_dummy_variables <- function(data, var_ordinal = NULL, var_nominal = NULL
))

if (!is.null(var_nominal)) {

if (!is.character(var_nominal))
stop("var_nominal must be a character name.")

index2 <- which(!var_nominal %in% xnames)

if (length(index2) != 0)
Expand Down

0 comments on commit 8d15350

Please sign in to comment.