# A very simple example using the pre-known true and false equivalents
categorical_values <- c("true","t","y","yes","f","no","1")
to_logical(categorical_values)
# Use a custom specifier
categorical_values <- c("NA","NA","NA","NA","NA","NA","NA","NA","Batman")
to_logical(categorical_values, custom_true = c("Batman"))
Run the code above in your browser using DataLab