jthomasmock / gtExtras

A Collection of Helper Functions for the gt Package.
https://jthomasmock.github.io/gtExtras/
Other
193 stars 26 forks source link

`gt_plt_summary` generates multiple "length 1, but the data has n rows" warnings #131

Open laresbernardo opened 2 months ago

laresbernardo commented 2 months ago

Every time I use gt_plt_summary() it generates and prints several times the following warnings:

Warning in geom_point(data = NULL, aes(x = rng_vals[2], y = 1), color = "transparent",  :
  All aesthetics have length 1, but the data has 208 rows.
ℹ Please consider using `annotate()` or provide this layer with data containing a single
  row.

For this reproducible example, it prints 22 times:

gtExtras::gt_plt_summary(mtcars)

I see this is happening with 0.5.0 (CRAN version) and 0.5.0.9005 (Github version) as well.

Would appreciate a fix so that I don't have to wrap it with suppressWarnings(print(...)). Thanks!