Skip to content

replace deprecated ggplot2::aes_string with ggplot2::aes - #27

Merged
corybrunson merged 8 commits into
tdaverse:masterfrom
SpatLyu:master
Sep 21, 2026
Merged

corybrunson merged 8 commits into
tdaverse:masterfrom
SpatLyu:master

Conversation

@SpatLyu

@SpatLyu SpatLyu commented Sep 18, 2026

Copy link
Copy Markdown
Contributor

This PR fixes the following ggplot2 warnings:

aes_string() is deprecated, use aes() instead

sim = tEDM::logistic_map(
  x = 0.4,y = 0.4,z = 0.4,step = 105,
  beta_xy = 0.5, beta_xz = 0,
  beta_yx = 0, beta_yz = 0.5,
  beta_zx = 0, beta_zy = 0)

mx = embed(sim$x, 6)
h = TDAstats::calculate_homology(mx,2)
TDAstats::plot_persist(h)
#> Warning: `aes_string()` was deprecated in ggplot2 3.0.0.
#> ℹ Please use tidy evaluation idioms with `aes()`.
#> ℹ See also `vignette("ggplot2-in-packages")` for more information.
#> ℹ The deprecated feature was likely used in the TDAstats package.
#>   Please report the issue at <https://github.com/tdaverse/TDAstats/issues>.
#> This warning is displayed once per session.
#> Call `lifecycle::last_lifecycle_warnings()` to see where this warning was
#> generated.

Created on 2026-09-18 with reprex v2.1.1

@corybrunson

Copy link
Copy Markdown
Member

Hi @SpatLyu, thanks for bringing this up. Per the warning message in the example, could you revise the PR to use tidy evaluation idioms? I found that Claus Wilke recommends the embrace operator here, but some SO answers recommend other fixes here and here. I believe these all use tidy evaluation, but presumably the first is favored by the developers. (Personally i'll also be glad to not have to use globalVariables().)

Also, in the interest of keeping things minimal, is it necessary to upgrade the documentation?

@SpatLyu

SpatLyu commented Sep 19, 2026

Copy link
Copy Markdown
Contributor Author

Hi @SpatLyu, thanks for bringing this up. Per the warning message in the example, could you revise the PR to use tidy evaluation idioms? I found that Claus Wilke recommends the embrace operator here, but some SO answers recommend other fixes here and here. I believe these all use tidy evaluation, but presumably the first is favored by the developers. (Personally i'll also be glad to not have to use globalVariables().)

@corybrunson, I have revised this PR to use the tidy evaluation idioms. It now works as expected:

sim = tEDM::logistic_map(
  x = 0.4,y = 0.4,z = 0.4,step = 105,
  beta_xy = 0.5, beta_xz = 0,
  beta_yx = 0, beta_yz = 0.5,
  beta_zx = 0, beta_zy = 0)

mx = embed(sim$x, 6)
h = TDAstats::calculate_homology(mx,2)
TDAstats::plot_persist(h)

sessionInfo()
#> R version 4.5.3 (2026-03-11 ucrt)
#> Platform: x86_64-w64-mingw32/x64
#> Running under: Windows 11 x64 (build 26200)
#> 
#> Matrix products: default
#>   LAPACK version 3.12.1
#> 
#> locale:
#> [1] LC_COLLATE=Chinese (Simplified)_China.utf8 
#> [2] LC_CTYPE=Chinese (Simplified)_China.utf8   
#> [3] LC_MONETARY=Chinese (Simplified)_China.utf8
#> [4] LC_NUMERIC=C                               
#> [5] LC_TIME=Chinese (Simplified)_China.utf8    
#> 
#> time zone: Asia/Shanghai
#> tzcode source: internal
#> 
#> attached base packages:
#> [1] stats     graphics  grDevices utils     datasets  methods   base     
#> 
#> loaded via a namespace (and not attached):
#>  [1] vctrs_0.7.3         cli_3.6.6           knitr_1.52         
#>  [4] rlang_1.3.0         xfun_0.60           otel_0.2.0         
#>  [7] generics_0.1.4      S7_0.2.2            labeling_0.4.3     
#> [10] glue_1.8.1          htmltools_0.5.9     scales_1.4.0       
#> [13] rmarkdown_2.32      grid_4.5.3          tibble_3.3.1       
#> [16] evaluate_1.0.5      TDAstats_0.4.2.9000 fastmap_1.2.0      
#> [19] yaml_2.3.12         lifecycle_1.0.5     tEDM_1.3           
#> [22] compiler_4.5.3      dplyr_1.2.1         fs_2.1.0           
#> [25] RColorBrewer_1.1-3  pkgconfig_2.0.3     Rcpp_1.1.2         
#> [28] farver_2.1.2        digest_0.6.39       R6_2.6.1           
#> [31] tidyselect_1.2.1    reprex_2.1.1        dichromat_2.0-1    
#> [34] pillar_1.11.1       magrittr_2.0.5      tools_4.5.3        
#> [37] withr_3.0.3         gtable_0.3.6        ggplot2_4.0.3

Created on 2026-09-19 with reprex v2.1.1

Also, in the interest of keeping things minimal, is it necessary to upgrade the documentation?

As for the documentation, I have simply upgraded roxygen2 to the latest version to keep up with its new configuration syntax, as we developers should keep the package up to date in a timely manner. The compiled documentation itself remains unchanged. I'm happy to revert if you'd prefer otherwise.

@corybrunson
corybrunson merged commit 4398f1e into tdaverse:master Sep 21, 2026
@corybrunson

Copy link
Copy Markdown
Member

@SpatLyu thanks! I confused myself with some local experiments, but i think it'll all wash out.

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

Successfully merging this pull request may close these issues.

2 participants