Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Function "has_groups()" is not found #6

Open
bjoleary opened this issue Jan 29, 2023 · 0 comments
Open

Function "has_groups()" is not found #6

bjoleary opened this issue Jan 29, 2023 · 0 comments

Comments

@bjoleary
Copy link

Thanks for this great package! Recent updates to other packages may have broken something. It looks like "has_groups()" is called in stat-econodist.R and may be an un-exported function from ggplot2?

Reprex:

set.seed(1)
library(ggeconodist)
#> Loading required package: ggplot2
#> Loading required package: grid
library(ggplot2)
example_data <- 
  tibble::enframe(
    x = sample(0:1000, 100, replace = TRUE),
    name = "test"
  )
example_plot <- 
  ggplot2::ggplot(
    data = example_data,
    mapping = 
      ggplot2::aes(
        x = .data$value,
        y = 1
      )
  ) + 
  ggplot2::geom_point(alpha = 0.25)

plot(example_plot)

example_plot <- 
  example_plot + 
  ggeconodist::geom_econodist()

plot(example_plot)
#> Error in `ggeconodist::geom_econodist()`:
#> ! Problem while computing stat.
#> ℹ Error occurred in the 2nd layer.
#> Caused by error in `has_groups()`:
#> ! could not find function "has_groups"

#> Backtrace:
#>      ▆
#>   1. ├─base::plot(example_plot)
#>   2. ├─ggplot2:::plot.ggplot(example_plot)
#>   3. │ ├─ggplot2::ggplot_build(x)
#>   4. │ └─ggplot2:::ggplot_build.ggplot(x)
#>   5. │   └─ggplot2:::by_layer(...)
#>   6. │     ├─rlang::try_fetch(...)
#>   7. │     │ ├─base::tryCatch(...)
#>   8. │     │ │ └─base (local) tryCatchList(expr, classes, parentenv, handlers)
#>   9. │     │ │   └─base (local) tryCatchOne(expr, names, parentenv, handlers[[1L]])
#>  10. │     │ │     └─base (local) doTryCatch(return(expr), name, parentenv, handler)
#>  11. │     │ └─base::withCallingHandlers(...)
#>  12. │     └─ggplot2 (local) f(l = layers[[i]], d = data[[i]])
#>  13. │       └─l$compute_statistic(d, layout)
#>  14. │         └─ggplot2 (local) compute_statistic(..., self = self)
#>  15. │           └─self$stat$setup_params(data, self$stat_params)
#>  16. │             └─ggeconodist (local) setup_params(...)
#>  17. └─base::.handleSimpleError(...)
#>  18.   └─rlang (local) h(simpleError(msg, call))
#>  19.     └─handlers[[1L]](cnd)
#>  20.       └─cli::cli_abort(...)
#>  21.         └─rlang::abort(...)

Created on 2023-01-29 with reprex v2.0.2

Session info
sessioninfo::session_info()
#> ─ Session info ───────────────────────────────────────────────────────────────
#>  setting  value
#>  version  R version 4.2.2 (2022-10-31)
#>  os       macOS Ventura 13.1
#>  system   x86_64, darwin22.1.0
#>  ui       unknown
#>  language (EN)
#>  collate  en_US.UTF-8
#>  ctype    en_US.UTF-8
#>  tz       America/New_York
#>  date     2023-01-29
#>  pandoc   2.19.2 @ /Applications/RStudio.app/Contents/Resources/app/quarto/bin/tools/ (via rmarkdown)
#> 
#> ─ Packages ───────────────────────────────────────────────────────────────────
#>  package     * version date (UTC) lib source
#>  assertthat    0.2.1   2019-03-21 [1] CRAN (R 4.2.0)
#>  cli           3.6.0   2023-01-09 [1] CRAN (R 4.2.2)
#>  colorspace    2.1-0   2023-01-23 [1] CRAN (R 4.2.2)
#>  curl          5.0.0   2023-01-12 [1] CRAN (R 4.2.2)
#>  DBI           1.1.3   2022-06-18 [1] CRAN (R 4.2.1)
#>  digest        0.6.31  2022-12-11 [1] CRAN (R 4.2.2)
#>  dplyr         1.0.10  2022-09-01 [1] CRAN (R 4.2.1)
#>  evaluate      0.19    2022-12-13 [1] CRAN (R 4.2.2)
#>  fansi         1.0.4   2023-01-22 [1] CRAN (R 4.2.2)
#>  farver        2.1.1   2022-07-06 [1] CRAN (R 4.2.1)
#>  fastmap       1.1.0   2021-01-25 [1] CRAN (R 4.2.0)
#>  fs            1.5.2   2021-12-08 [1] CRAN (R 4.2.0)
#>  generics      0.1.3   2022-07-05 [1] CRAN (R 4.2.1)
#>  ggeconodist * 0.1.0   2023-01-29 [1] Github (hrbrmstr/ggeconodist@a4b1fa1)
#>  ggplot2     * 3.4.0   2022-11-04 [1] CRAN (R 4.2.2)
#>  glue          1.6.2   2022-02-24 [1] CRAN (R 4.2.0)
#>  gtable        0.3.1   2022-09-01 [1] CRAN (R 4.2.1)
#>  highr         0.10    2022-12-22 [1] CRAN (R 4.2.2)
#>  htmltools     0.5.4   2022-12-07 [1] CRAN (R 4.2.2)
#>  httr          1.4.4   2022-08-17 [1] CRAN (R 4.2.1)
#>  knitr         1.41    2022-11-18 [1] CRAN (R 4.2.2)
#>  labeling      0.4.2   2020-10-20 [1] CRAN (R 4.2.0)
#>  lifecycle     1.0.3   2022-10-07 [1] CRAN (R 4.2.2)
#>  magrittr      2.0.3   2022-03-30 [1] CRAN (R 4.2.0)
#>  mime          0.12    2021-09-28 [1] CRAN (R 4.2.0)
#>  munsell       0.5.0   2018-06-12 [1] CRAN (R 4.2.0)
#>  pillar        1.8.1   2022-08-19 [1] CRAN (R 4.2.1)
#>  pkgconfig     2.0.3   2019-09-22 [1] CRAN (R 4.2.0)
#>  R6            2.5.1   2021-08-19 [1] CRAN (R 4.2.0)
#>  reprex        2.0.2   2022-08-17 [1] CRAN (R 4.2.1)
#>  rlang         1.0.6   2022-09-24 [1] CRAN (R 4.2.2)
#>  rmarkdown     2.19    2022-12-15 [1] CRAN (R 4.2.2)
#>  rstudioapi    0.14    2022-08-22 [1] CRAN (R 4.2.1)
#>  scales        1.2.1   2022-08-20 [1] CRAN (R 4.2.1)
#>  sessioninfo   1.2.2   2021-12-06 [1] CRAN (R 4.2.0)
#>  stringi       1.7.12  2023-01-11 [1] CRAN (R 4.2.2)
#>  stringr       1.5.0   2022-12-02 [1] CRAN (R 4.2.2)
#>  tibble        3.1.8   2022-07-22 [1] CRAN (R 4.2.1)
#>  tidyselect    1.2.0   2022-10-10 [1] CRAN (R 4.2.2)
#>  utf8          1.2.2   2021-07-24 [1] CRAN (R 4.2.0)
#>  vctrs         0.5.2   2023-01-23 [1] CRAN (R 4.2.2)
#>  withr         2.5.0   2022-03-03 [1] CRAN (R 4.2.0)
#>  xfun          0.36    2022-12-21 [1] CRAN (R 4.2.2)
#>  xml2          1.3.3   2021-11-30 [1] CRAN (R 4.2.0)
#>  yaml          2.3.6   2022-10-18 [1] CRAN (R 4.2.2)
#> 
#>  [1] /usr/local/lib/R/site-library
#>  [2] /usr/local/Cellar/r/4.2.2_1/lib/R/library
#> 
#> ──────────────────────────────────────────────────────────────────────────────
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant