A kind of improved summary
digest(x)
x |
|
---|
For numeric
columns, returns a tiny summary
.
For character
/factor
columns, returns a count table.
For the two previous cases tests if values are constant or unique, respectively.
In both cases, returning a tibble would not be useful,
but knowing that a character
/factor
is unique can be useful
when making an id
column.
Also report NA cases, if any.
For tibbles, prints a colwise digest.
# numeric 1:5 %>% digest#> # A tibble: 3 x 2 #> quantile value #> <chr> <dbl> #> 1 min 1 #> 2 median 3 #> 3 max 5#> # A tibble: 4 x 2 #> quantile value #> <chr> <dbl> #> 1 <NA> 1 #> 2 min 1 #> 3 median 3 #> 4 max 5#> [1] "constant (5)"# factor iris$Species %>% digest#> # A tibble: 3 x 2 #> level count #> <chr> <int> #> 1 setosa 50 #> 2 versicolor 50 #> 3 virginica 50#> # A tibble: 4 x 2 #> quantile value #> <chr> <dbl> #> 1 <NA> 1 #> 2 min 1 #> 3 median 2 #> 4 max 3#> # A tibble: 1 x 2 #> level count #> <chr> <int> #> 1 a 5