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

regroup errors on zero-row data frames #486

Closed
wch opened this issue Jul 8, 2014 · 6 comments
Closed

regroup errors on zero-row data frames #486

wch opened this issue Jul 8, 2014 · 6 comments
Assignees
Labels
Milestone

Comments

@wch
Copy link
Member

@wch wch commented Jul 8, 2014

This causes problems for zero-row data in ggvis:

dplyr::regroup(data.frame(a = numeric(0), g = character(0)), list(quote(g)))
# Error: upper value must be greater than lower value

# Slightly closer to the source of the problem:
dplyr:::grouped_df_impl(data.frame(a = numeric(0), g = character(0)), list(quote(g)), drop = TRUE)
@hadley hadley added the bug label Jul 28, 2014
@hadley hadley added this to the 0.3 milestone Jul 28, 2014
@hadley
Copy link
Member

@hadley hadley commented Jul 28, 2014

@romainfrancois I think in this case we should get an index list of length 0. That will probably require flow through changes elsewhere.

@romainfrancois
Copy link
Member

@romainfrancois romainfrancois commented Jul 28, 2014

An 0-length index list is the way to go, yes. Although I'm kind of expecting that when there is a group, there is at least one element, so some things might break.

@wch
Copy link
Member Author

@wch wch commented Sep 11, 2014

@romainfrancois Any chance you can get to this one soonish? I've added a fair bit of workaround code for this in ggvis, and it would be nice to get rid of it. :)

@romainfrancois
Copy link
Member

@romainfrancois romainfrancois commented Sep 11, 2014

sure @wch I'll take a look.

@romainfrancois
Copy link
Member

@romainfrancois romainfrancois commented Sep 11, 2014

I think this commit took care of it. fd00ad2
(although I messed up with the issue number).

@wch
Copy link
Member Author

@wch wch commented Sep 12, 2014

Thanks! I think it works, but my tests still don't pass because now I'm running into #593. :-/

@hadley hadley closed this Sep 12, 2014
@lock lock bot locked as resolved and limited conversation to collaborators Jun 10, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
3 participants