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

group_by with a grouping variable with missing data causes R to crash #183

jeromyanglim opened this issue Jan 18, 2014 · 3 comments
bug an unexpected problem or unintended behavior


Copy link

It seems that group_by with missing data on the grouping variable causes R to crash


names(survey) <- tolower(names(survey))
group_by(na.omit(survey), m.i) #works fine
group_by(survey), m.i) # causes r to crash
 *** caught segfault ***
address 0xfffffffd0214f288, cause 'memory not mapped'

 1: .Call("dplyr_grouped_df_impl", PACKAGE = "dplyr", data, symbols,     drop)
 2: grouped_df_impl(data, unname(vars), drop)
 3: grouped_df(x, value)
 4:, new_groups)
 5: regroup(x, new_groups)
 6: group_by(survey, m.i)

Possible actions:
1: abort (with core dump, if enabled)
2: normal R exit
3: exit R without saving workspace
4: exit R saving workspace
Copy link

hadley commented Jan 18, 2014

Ooops, I thought we'd tested that case already.

@ghost ghost assigned romainfrancois Jan 18, 2014
Copy link

More precisely, this is because m.i is a factor and FactorVisitor does not take that case into account.

What should happen ? Should we have one group related to all NA from m.i ?

Copy link

hadley commented Jan 18, 2014

Right, NAs should just turn into another group (which by convention, would be the last group)

@lock lock bot locked as resolved and limited conversation to collaborators Jun 11, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
bug an unexpected problem or unintended behavior
None yet

No branches or pull requests

3 participants