Skip to content
New issue

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

arrange is not supported #47

Open
LaurentSmeets opened this issue Jul 18, 2020 · 3 comments
Open

arrange is not supported #47

LaurentSmeets opened this issue Jul 18, 2020 · 3 comments

Comments

@LaurentSmeets
Copy link

Considering arrange() is part of dplyr and tidyr I would expected support for it. For example:

iris %>%
  group_by(Species) %>%
  summarise(mean_Sepal_Length = mean(Sepal.Length), .groups = "drop") %>%
  arrange(desc(mean_Sepal_Length))

now gives:

group_by: one grouping variable (Species)
summarise: now 3 rows and 2 columns, ungrouped

while I would expect something like

group_by: one grouping variable (Species)
summarise: now 3 rows and 2 columns, ungrouped
arrange: now arranged in descending order by one variable (mean_Sepal_Length)

I think that would be a nice addition, if it would fit within the logic of this package.

@elbersb
Copy link
Owner

elbersb commented Jul 28, 2020

I was always hesitant to add information about arrange because it seems so obvious what is happening, but I guess there is some value in it -- especially if your data is grouped and you possibly sort within groups inadvertently.

@hhhh5
Copy link

hhhh5 commented Apr 7, 2024

Would it make sense to print information about the number of rows with NAs among the columns used for sorting? A user might not be aware whether there are any missings in the data. dplyr::arange() puts them last so it printing the head of a data.frame doesn't reveal such instances.

@elbersb
Copy link
Owner

elbersb commented Apr 17, 2024

interesting! I'm probably not going to implement this, but would be open to a PR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants