ropensci/skimr

Numbers that should be zero are displayed in scientific notation

Ouverte

#479 ouverte le 21 juil. 2019

 (19 commentaires) (0 réaction) (0 personne assignée)HTML (77 forks)batch import
help wanted

Métriques du dépôt

Stars
 (1 061 étoiles)
Métriques de merge PR
 (Aucune PR mergée en 30 j)

Description

This may be an issue with R as opposed to skimr, but it always bothers me. I'd appreciate help if you have any. Basically, numbers that should be essentially zero are displayed in scientific notation. Is there some way to avoid this other than the round() function? Here is an example:

library(tibble)
library(dplyr)
library(skimr)
t <- tibble::tibble(
  x = c(7.250, 71.283, 7.925, 53.100, 8.050, 8.458, 51.862, 21.075, 11.133, 30.071)
)
t <- dplyr::mutate(t, 
  x_c = x - mean(x), 
  x_z = x_c / sd(x)
)
skim(t)
#> Skim summary statistics
#>  n obs: 10 
#>  n variables: 3 
#> 
#> -- Variable type:numeric -------------------------------------------------------
#>  variable missing complete  n     mean   sd     p0    p25    p50   p75  p100     hist
#>         x       0       10 10 27.02    23.6   7.25   8.15  16.1  46.41 71.28 ▇▂▂▁▁▃▁▂
#>       x_c       0       10 10 -8.9e-16 23.6 -19.77 -18.87 -10.92 19.39 44.26 ▇▂▂▁▁▃▁▂
#>       x_z       0       10 10 -3.3e-17  1    -0.84  -0.8   -0.46  0.82  1.88 ▇▂▂▁▁▃▁▂

Guide contributeur