From 1f2d19c92bf672b947b85bcb0360000c70108f76 Mon Sep 17 00:00:00 2001 From: etiennebacher Date: Wed, 3 Aug 2022 16:58:13 +0200 Subject: [PATCH] convert to char if factor --- R/separate.R | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/R/separate.R b/R/separate.R index 6eb11b9..9807cf2 100644 --- a/R/separate.R +++ b/R/separate.R @@ -91,7 +91,7 @@ separate <- function( stopifnot(length(col) == 1) stopifnot(is.character(into)) - if (is.numeric(data[[col]])) { + if (is.numeric(data[[col]]) | is.factor(data[[col]])) { data[[col]] <- as.character(data[[col]]) }