Skip to content

in group_by, NA_character_ replaced by "" (empty string) #1839

@bart6114

Description

@bart6114

relates to #1671

Apparently this bug is still here. Consider this adapted example from #1671:

test <- data.frame(id = rep(1:4, each = 3), grade = rep(c(NA, "a", NA, "b"), each = 3), stringsAsFactors = FALSE)

test %>% 
  group_by(id) %>% 
  dplyr::summarise(test = grade[1])

Results in:

     id  test
  (int) (chr)
1     1      
2     2     a
3     3    NA
4     4     b

Installing the latest dev version, as well as the suggested commit 9bae2aa, doesn't fix this issue.

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