4
I’m making the filter on df
gapminder
, generating a df
empty when I use the variable gdpPercap
:
library(gapminder) # versão 0.2.0
library(dplyr) # versão 0.7.2
gapminder %>%
filter(year == 2007, gdpPercap==max(gdpPercap))
# A tibble: 0 x 6
# ... with 6 variables: country <fctr>, continent <fctr>, year <int>, lifeExp <dbl>, pop <int>, gdpPercap <dbl>
If I change the query variable, the expected result appears
gapminder %>%
filter(year == 2007, pop==max(pop))
# A tibble: 1 x 6
# country continent year lifeExp pop gdpPercap
#1 China Asia 2007 72.961 1318683096 4959.115
Would be a bug of dplyr
? I am using Rstudio (Version 1.0.143) and MRO (3.3.3).