Metropolitan-Council / councilR

A curated collection of commonly used templates, color palettes, functions, and more!
Other
6 stars 1 forks source link

theme_council error #36

Open ehesch opened 2 years ago

ehesch commented 2 years ago

Argh! An issue with the ggplot themes.... I'm getting thrown an Error: object of type 'closure' is not subsettable issue when using the theme_council() call (but no error when using the old council_theme() call). Any ideas here @eroten ?

``` r
datasets::cars %>%
  ggplot(aes(x = speed, y = dist)) +
  geom_point() +
  councilR::theme_council()
#> Error in datasets::cars %>% ggplot(aes(x = speed, y = dist)): could not find function "%>%"

Created on 2022-05-03 by the reprex package (v2.0.1)

Session info ``` r sessioninfo::session_info() #> ─ Session info ─────────────────────────────────────────────────────────────── #> setting value #> version R version 4.0.5 (2021-03-31) #> os macOS Catalina 10.15.6 #> system x86_64, darwin17.0 #> ui X11 #> language (EN) #> collate en_US.UTF-8 #> ctype en_US.UTF-8 #> tz America/Chicago #> date 2022-05-03 #> pandoc 2.11.4 @ /Applications/RStudio.app/Contents/MacOS/pandoc/ (via rmarkdown) #> #> ─ Packages ─────────────────────────────────────────────────────────────────── #> package * version date (UTC) lib source #> cli 3.2.0 2022-02-14 [1] CRAN (R 4.0.5) #> crayon 1.5.1 2022-03-26 [1] CRAN (R 4.0.5) #> digest 0.6.29 2021-12-01 [1] CRAN (R 4.0.2) #> ellipsis 0.3.2 2021-04-29 [1] CRAN (R 4.0.2) #> evaluate 0.15 2022-02-18 [1] CRAN (R 4.0.5) #> fansi 1.0.3 2022-03-24 [1] CRAN (R 4.0.5) #> fastmap 1.1.0 2021-01-25 [1] CRAN (R 4.0.2) #> fs 1.5.2 2021-12-08 [1] CRAN (R 4.0.2) #> glue 1.6.2 2022-02-24 [1] CRAN (R 4.0.5) #> highr 0.9 2021-04-16 [1] CRAN (R 4.0.2) #> htmltools 0.5.2 2021-08-25 [1] CRAN (R 4.0.2) #> knitr 1.38 2022-03-25 [1] CRAN (R 4.0.5) #> lifecycle 1.0.1 2021-09-24 [1] CRAN (R 4.0.2) #> magrittr 2.0.2 2022-01-26 [1] CRAN (R 4.0.5) #> pillar 1.7.0 2022-02-01 [1] CRAN (R 4.0.5) #> pkgconfig 2.0.3 2019-09-22 [1] CRAN (R 4.0.2) #> purrr 0.3.4 2020-04-17 [1] CRAN (R 4.0.2) #> R.cache 0.15.0 2021-04-30 [1] CRAN (R 4.0.2) #> R.methodsS3 1.8.1 2020-08-26 [1] CRAN (R 4.0.2) #> R.oo 1.24.0 2020-08-26 [1] CRAN (R 4.0.2) #> R.utils 2.11.0 2021-09-26 [1] CRAN (R 4.0.2) #> reprex 2.0.1 2021-08-05 [1] CRAN (R 4.0.2) #> rlang 1.0.2 2022-03-04 [1] CRAN (R 4.0.5) #> rmarkdown 2.13 2022-03-10 [1] CRAN (R 4.0.5) #> rstudioapi 0.13 2020-11-12 [1] CRAN (R 4.0.2) #> sessioninfo 1.2.2 2021-12-06 [1] CRAN (R 4.0.2) #> stringi 1.7.6 2021-11-29 [1] CRAN (R 4.0.2) #> stringr 1.4.0 2019-02-10 [1] CRAN (R 4.0.2) #> styler 1.7.0 2022-03-13 [1] CRAN (R 4.0.5) #> tibble 3.1.6 2021-11-07 [1] CRAN (R 4.0.2) #> utf8 1.2.2 2021-07-24 [1] CRAN (R 4.0.2) #> vctrs 0.3.8 2021-04-29 [1] CRAN (R 4.0.2) #> withr 2.5.0 2022-03-03 [1] CRAN (R 4.0.5) #> xfun 0.30 2022-03-02 [1] CRAN (R 4.0.5) #> yaml 2.3.5 2022-02-21 [1] CRAN (R 4.0.5) #> #> [1] /Users/escheh/Library/R/4.0/library #> [2] /Library/Frameworks/R.framework/Versions/4.0/Resources/library #> #> ────────────────────────────────────────────────────────────────────────────── ```
```
eroten commented 2 years ago

Thank you for the reprex!

I've encountered this as well. To remedy this, call library(councilR) before using theme_council()