jthomasmock / gtExtras

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

`scales::label_number_si()` will be deprecated in a future scales release #48

Closed mrcaseb closed 2 years ago

mrcaseb commented 2 years ago

While checking #39 I found the vignette erroring because of a missing "unit" argument. UPDATE: this won't error in the newest scales dev version

This happened because I am running the current dev version of scales (1.1.1.9000) which has deprecated scales::label_number_si() and additionally changed the order of arguments (UPDATE: the newest dev version fixed the argument order problem). I think the latter wasn't on purpose but it will definitely break gtExtras functions that are using scales::label_number_si().

grafik

Since gtExtras is depending on non CRAN packages anyway, I suggest replacing scales::label_number_si() with scales::label_number() and require scales > 1.1.1.

These are the appearances in gtExtras

https://github.com/jthomasmock/gtExtras/blob/ddcc292d08cc89c6d8a079f2e50f68698a9d6706/R/gt_plt_point.R#L21 https://github.com/jthomasmock/gtExtras/blob/e671b466a5cf393ed7dfd1f351f10632b2b2df8c/R/gt_pct_bar.R#L58 https://github.com/jthomasmock/gtExtras/blob/ddcc292d08cc89c6d8a079f2e50f68698a9d6706/R/gt_plt_sparkline.R#L107 https://github.com/jthomasmock/gtExtras/blob/ddcc292d08cc89c6d8a079f2e50f68698a9d6706/R/gt_sparkline.R#L126

mrcaseb commented 2 years ago

An update to the dev version of scales, unfortunately without changing the version number, fixed the missing argument bug so this is not an acute problem, sorry.

I keep the issue open because the function will be deprecated and in fact doesn't use correct SI prefixes.

jthomasmock commented 2 years ago

Thanks @mrcaseb - good to know re: label_number_si()