We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
do()
When executing an arbitrary function on a grouped data frame using do(), ordered factors lose their order:
library(dplyr) l <- c("a", "b", "c", "d") id <- factor(c("a", "c", "d"), levels = l, ordered = TRUE) df <- data.frame(id = rep(id, 2), val = rnorm(6)) levels(df$id) ## [1] "a" "b" "c" "d" is.ordered(df$id) ## [1] TRUE out <- group_by(df, id) %>% do(na.omit(.)) levels(out$id) # Levels are retained ## [1] "a" "b" "c" "d" is.ordered(out$id) # Loses ordering ## [1] FALSE
The text was updated successfully, but these errors were encountered:
This is probably a bind_rows() problem
bind_rows()
Sorry, something went wrong.
95eda6b
romainfrancois
No branches or pull requests
When executing an arbitrary function on a grouped data frame using
do()
, ordered factors lose their order:The text was updated successfully, but these errors were encountered: