commit | 6adba33407ead4e8f473a29d83c035a2f2ae2342 | [log] [tgz] |
---|---|---|
author | Hao Zhu <haozhu233@gmail.com> | Wed Aug 19 11:48:51 2020 -0400 |
committer | Hao Zhu <haozhu233@gmail.com> | Wed Aug 19 11:48:51 2020 -0400 |
tree | 1dfcd9d4d28704c6b2e67bbacef8a062dffddb2a | |
parent | 83a2ab5841f92e7c340c53aa6e11b2d3667ddb55 [diff] |
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