Ok I am posting this here only because I just encountered this while using the dev. version of dplyr.
Is anyone else encountering this?
I encountered the following issue when trying to use dplyr
(version 0.7.5.9000).
Is anyone else encountering this?
library(dplyr)
#>
#> Attaching package: 'dplyr'
#> The following objects are masked from 'package:stats':
#>
#> filter, lag
#> The following objects are masked from 'package:base':
#>
#> intersect, setdiff, setequal, union
library(magrittr)
library(reprex)
data <- data_frame(
id = c('a', 'a', 'b', 'b', 'c'),
val = c(1, 2, 0, 1, 2)
)
data %>%
dplyr::count(id)
#> Error in summarise_impl(.data, dots) : `.data` is a corrupt grouped_df
# I can always resort to this...
# (but at the expense of 'oh-so-many' keystrokes :())
data %$% base::table(id) %>% tibble::as_tibble()
#> # A tibble: 3 x 2
#> id n
#> <chr> <int>
#> 1 a 2
#> 2 b 2
#> 3 c 1
# session information ----
packageVersion(pkg = "dplyr")
#> [1] '0.7.5.9000'
packageVersion(pkg = "magrittr")
#> [1] '1.5'
glimpse(as_tibble(R.Version()))
#> Observations: 1
#> Variables: 14
#> $ platform <chr> "x86_64-apple-darwin15.6.0"
#> $ arch <chr> "x86_64"
#> $ os <chr> "darwin15.6.0"
#> $ system <chr> "x86_64, darwin15.6.0"
#> $ status <chr> ""
#> $ major <chr> "3"
#> $ minor <chr> "5.0"
#> $ year <chr> "2018"
#> $ month <chr> "04"
#> $ day <chr> "23"
#> $ `svn rev` <chr> "74626"
#> $ language <chr> "R"
#> $ version.string <chr> "R version 3.5.0 (2018-04-23)"
#> $ nickname <chr> "Joy in Playing"
cderv
June 7, 2018, 8:55pm
2
There is currently one issue with this error in dplyr repo
opened 01:00PM - 06 Jun 18 UTC
closed 08:52PM - 10 Jun 18 UTC
Error does not happens every time, using 100 attempts I was able to reproduce it… always, on two different machines.
```r
library(dplyr)
read.dcf(system.file("DESCRIPTION", package="dplyr"), fields="RemoteSha")[[1L]]
#[1] "379480c555c1a19af4c4bbb135662ec4cac169a6"
sessionInfo()
#R version 3.5.0 (2018-04-23)
#Platform: x86_64-pc-linux-gnu (64-bit)
#Running under: Ubuntu precise (12.04.5 LTS)
#
#Matrix products: default
#BLAS: /usr/local/lib/R/lib/libRblas.so
#LAPACK: /usr/local/lib/R/lib/libRlapack.so
#
#locale:
# [1] LC_CTYPE=en_US.UTF-8 LC_NUMERIC=C
# [3] LC_TIME=en_US.UTF-8 LC_COLLATE=en_US.UTF-8
# [5] LC_MONETARY=en_US.UTF-8 LC_MESSAGES=en_US.UTF-8
# [7] LC_PAPER=en_US.UTF-8 LC_NAME=C
# [9] LC_ADDRESS=C LC_TELEPHONE=C
#[11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C
#
#attached base packages:
#[1] stats graphics grDevices utils datasets methods base
#
#other attached packages:
#[1] dplyr_0.7.5.9000
#
#loaded via a namespace (and not attached):
# [1] tidyselect_0.2.4 compiler_3.5.0 magrittr_1.5 assertthat_0.2.0
# [5] R6_2.2.2 pillar_1.2.3 bindrcpp_0.2.2 glue_1.2.0
# [9] tibble_1.4.2 Rcpp_0.12.17 pkgconfig_2.0.1 rlang_0.2.0.9001
#[13] purrr_0.2.5 bindr_0.1.1
#
set.seed(108)
DF <- data.frame(
id1 = sample(sprintf("id%03d",1:100), 1e9, TRUE),
v1 = sample(5, 1e9, TRUE),
stringsAsFactors = FALSE
)
for (i in 1:100) summarise(group_by(DF, id1), sum(v1))
#Error in summarise_impl(.data, dots) : `.data` is a corrupt grouped_df
```
I had this one today with dev dplyr, but it was a bit random. I assume there was something going on with dev version and its dependencies. So I used new 0.7.5 one from CRAN instead.
FWIW I can't reproduce after a fresh install of dev dplyr version. Is it fixed or just random ?
devtools::dev_mode(on = TRUE)
#> Dev mode: ON
library(dplyr, warn.conflicts = FALSE)
packageVersion("dplyr")
#> [1] '0.7.5.9000'
data <- data_frame(
id = c('a', 'a', 'b', 'b', 'c'),
val = c(1, 2, 0, 1, 2)
)
data %>%
dplyr::count(id)
#> # A tibble: 3 x 2
#> id n
#> <chr> <int>
#> 1 a 2
#> 2 b 2
#> 3 c 1
Created on 2018-06-07 by the reprex package (v0.2.0).
1 Like
Ok I will re-download/install the dev version and see if that fixes it.
Thank you!