Inputs a dataframe and returns various summary statistics of the numeric columns. For example zeros returns the ratio of 0 values in that column. minus counts negative values and infs counts Inf values. Other rarer metrics are also returned that may be helpful for quick diagnosis or understanding of numeric data. mode returns the most common value in the column (chooses at random in case of tie) , and mode_ratio returns its frequency as a ratio of the total rows

diagnose_numeric(.data, ...)

Arguments

.data

dataframe

...

tidyselect. Default: all numeric columns

Value

dataframe

Examples

iris %>%
diagnose_numeric() %>%
print(width = Inf)
#> 150 rows
#> some elements containing non-numeric values have been parsed as integers
#> some elements containing non-numeric values have been parsed as integers
#> some elements containing non-numeric values have been parsed as integers
#> # A tibble: 4 × 10
#>   variables    zeros  minus  infs     min  mean   max `|x|<=1 (ratio)`
#>   <chr>        <chr>  <chr>  <chr>  <int> <int> <int> <chr>           
#> 1 Sepal.Length 0 (0%) 0 (0%) 0 (0%)     4     5     7 0 (0%)          
#> 2 Sepal.Width  0 (0%) 0 (0%) 0 (0%)     2     3     4 0 (0%)          
#> 3 Petal.Length 0 (0%) 0 (0%) 0 (0%)     1     3     6 1 (1%)          
#> 4 Petal.Width  0 (0%) 0 (0%) 0 (0%)     0     1     2 57 (38%)        
#>   integer_ratio mode     
#>   <chr>         <chr>    
#> 1 17 (11%)      5 (7%)   
#> 2 28 (19%)      3 (17%)  
#> 3 13 (9%)       1.4 (9%) 
#> 4 13 (9%)       0.2 (19%)