craddm / eegUtils

An R package for processing and plotting of electroencephalography (EEG) data
https://craddm.github.io/eegUtils/
Other
105 stars 27 forks source link

`ggplot2` 3.4.0 causes warnings with many plotting functions #132

Closed craddm closed 1 year ago

craddm commented 1 year ago

The latest version of ggplot2 causes warnings when aesthetics are dropped/not used during statistical transformations unless they're explicitly declared in the stat* or geom* code. I use custom stats and geoms where this isn't implemented. The plots are all actually fine.

library(eegUtils); topoplot(demo_epochs,
                        limits = c(-2.87, 4.69))
#> 
#> Attaching package: 'eegUtils'
#> The following object is masked from 'package:stats':
#> 
#>     filter
#> Creating epochs based on combinations of variables: epoch_label participant_id
#> Using electrode locations from data.
#> Plotting head r 95 mm
#> Warning: The following aesthetics were dropped during statistical transformation: z,
#> fill
#> ℹ This can happen when ggplot fails to infer the correct grouping structure in
#>   the data.
#> ℹ Did you forget to specify a `group` aesthetic or to convert a numerical
#>   variable into a factor?
#> Warning: The following aesthetics were dropped during statistical transformation: fill
#> ℹ This can happen when ggplot fails to infer the correct grouping structure in
#>   the data.
#> ℹ Did you forget to specify a `group` aesthetic or to convert a numerical
#>   variable into a factor?
#> The following aesthetics were dropped during statistical transformation: fill
#> ℹ This can happen when ggplot fails to infer the correct grouping structure in
#>   the data.
#> ℹ Did you forget to specify a `group` aesthetic or to convert a numerical
#>   variable into a factor?
#> The following aesthetics were dropped during statistical transformation: fill
#> ℹ This can happen when ggplot fails to infer the correct grouping structure in
#>   the data.
#> ℹ Did you forget to specify a `group` aesthetic or to convert a numerical
#>   variable into a factor?
#> The following aesthetics were dropped during statistical transformation: fill
#> ℹ This can happen when ggplot fails to infer the correct grouping structure in
#>   the data.
#> ℹ Did you forget to specify a `group` aesthetic or to convert a numerical
#>   variable into a factor?

Created on 2023-02-17 with reprex v2.0.2

craddm commented 1 year ago

Fixed on dev branch