uclahs-cds / package-BoutrosLab-plotting-general

Functions to Create Publication-Quality Plots
https://uclahs-cds.github.io/package-BoutrosLab-plotting-general
11 stars 4 forks source link

scientific.notation does not respect parameters for lists #144

Open nwiltsie opened 1 year ago

nwiltsie commented 1 year ago

https://github.com/uclahs-cds/public-R-BoutrosLab-plotting-general/blob/982f2c7287f802a133c1e1d71d2b95e44464771d/R/scientific.notation.R#L13-L23

This recursive call strips away the digits and expression parameters so that calling this function on a list does not give the expected result:

> c(scientific.notation(1.234e8, digits = 2), scientific.notation(654.32e8, digits = 2))
expression("1.23" %*% 10^8, "6.54" %*% 10^10)
> scientific.notation(c(1.234e8, 654.32e8), digits = 2)
expression("1.2" %*% 10^8, "6.5" %*% 10^10)