ggstatsplot icon indicating copy to clipboard operation
ggstatsplot copied to clipboard

Turning off scientific notation

Open Andrzej-Andrzej opened this issue 2 years ago • 3 comments

In this new version 0.9.4 is there finally a possibility to turn off scientific notation in plots and round p-values to the desired level of decimal places ?

Andrzej-Andrzej avatar Aug 12 '22 09:08 Andrzej-Andrzej

It would be good to know if this is possible to achieve as of current version. I tried passing scipen = 999L to the ggbetweenstats() function and setting options(scipen = 999L) globally and both of these don't work.

davidbudzynski avatar Sep 07 '22 09:09 davidbudzynski

This would indeed be awesome! Is there a temporary workaround for this?

andreifoldes avatar Jan 28 '23 17:01 andreifoldes

Is it finally fixed ?

Andrzej-Andrzej avatar Nov 11 '23 19:11 Andrzej-Andrzej

Is it finally fixed ?

There still seems to be no way to turn it off, and I would also like to ask how to stop scientific notation and keep up to a specific number of decimal places.

hasibagen avatar Mar 11 '24 07:03 hasibagen

Next time, it would help for someone to actually include a reproducible example so that I can work off of it.

Anyway, it's not easy to display numbers in expressions in a way that would keep the expression succinct and still cover all possible values that can potentially be displayed (from -Inf to Inf). This is why whether the numbers are displayed in scientific notation or not depends on the number of rounding digits chosen and how small/big the value is. This is currently controlled in {ggstatsplot} by (the terribly named) k parameter.


Default: scientific notation

set.seed(123)
library(ggstatsplot)
library(WRS2)

ggwithinstats(
  WineTasting,
  Wine,
  Taste,
  paired = TRUE,
  k = 2L # default
)

Changing default: No scientific notation


ggwithinstats(
  WineTasting,
  Wine,
  Taste,
  paired = TRUE,
  k = 4L 
)

Created on 2024-03-17 with reprex v2.1.0

IndrajeetPatil avatar Mar 17 '24 11:03 IndrajeetPatil