Fix #390
diff --git a/R/group_rows.R b/R/group_rows.R
index 7579782..8c73143 100644
--- a/R/group_rows.R
+++ b/R/group_rows.R
@@ -323,6 +323,7 @@
 #'
 #' @export
 auto_index <- function(x) {
+  if (is.factor(x)) x <- as.character(x)
   x_rle <- rle(x)
   index <- x_rle$lengths
   names(index) <- x_rle$values