As explained in https://github.com/cienciadedatos/r4ds/issues/68 and the references therein, installing the current tidyverse
version from CRAN on a fresh R setup (i.e. building to gh-pages via Travis CI or just new laptop) breaks the code from the examples exposed in model-many.Rmd
from R4DS
The issue that I make reference to is from the spanish R4DS translation and its causes were very tricky to detect.
It looks like it's related to dplyr 0.8.0.
devtools::install_github("pachamaltese/datos")
library("datos")
library("tidyverse")
por_pais <- paises %>%
group_by(pais, continente) %>%
nest()
# With 0.7.8
sum(map_lgl(por_pais$data, is.null))
#> [1] 0
# With 0.8.0
sum(map_lgl(por_pais$data, is.null))
#> [1] 113
I believe this is related to this tidyr
PR. https://github.com/tidyverse/tidyr/pull/511
In the PR, tidyr::nest()
uses the new group_nest()
, and would give e.g.:
library("datos")
library("tidyverse")
#> Warning: package 'tibble' was built under R version 3.5.2
por_pais <- paises %>%
group_by(pais, continente) %>%
group_nest()
# With 0.8.0
sum(map_lgl(por_pais$data, is.null))
#> [1] 0
Created on 2019-02-20 by the reprex package (v0.2.1.9000)
馃敟馃
Most helpful comment
馃敟馃