Skip to content

Calling first() in summarise() on a non-existent column causes segfault (and crashes R) #600

@Qzrx

Description

@Qzrx

R version 3.1.0 (2014-04-10) -- "Spring Dance", OSX 64-bit
dplyr 0.2.0.99

If I take a data frame and then try summarizing using first value of a non-existing column, dplyr gets very unhappy. Which is good--it shouldn't silently eat the error!

Unfortunately it doesn't return an error or warning. Instead it just outright crashes the entire R session. Meep.

foo = data.frame(x = 1:10, y = 1:10)
foo %>%
  group_by(x) %>% 
  summarise(first_y = first(y)) # perfectly happy!
foo = data.frame(x = 1:10, y = 1:10)
foo %>%
  group_by(x) %>% 
  summarise(first_y = first(z)) # CRAAAAASH!

Metadata

Metadata

Labels

bugan unexpected problem or unintended behavior

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions