Skip to contents

You can calculate a series of summary statistics (features) of a given variable for a dataset. For example, a three number summary, the minimum, median, and maximum, can be calculated for a given variable. This is designed to work with the features() function shown in the examples. Other available features in brolgar include:

  • feat_three_num() - minimum, median, maximum

  • feat_five_num() - minimum, q25, median, q75, maximum.

  • feat_ranges() - min, max, range difference, interquartile range.

  • feat_spread() - variance, standard deviation, median absolute distance, and interquartile range

  • feat_monotonic() - is it always increasing, decreasing, or unvarying?

  • feat_diff_summary() - the summary statistics of the differences amongst a value, including the five number summary, as well as the standard deviation and variance. Returns NA if there is only one observation, as we can't take the difference of one observation, and a difference of 0 in these cases would be misleading.

  • feat_brolgar() all features in brolgar.

Usage

feat_three_num(x, ...)

feat_five_num(x, ...)

feat_ranges(x, ...)

feat_spread(x, ...)

feat_monotonic(x, ...)

feat_brolgar(x, ...)

feat_diff_summary(x, ...)

Arguments

x

A vector to extract features from.

...

Further arguments passed to other functions.

Examples


# You can use any of the features `feat_*` in conjunction with `features` 
# like so:
heights %>%
  features(height_cm, # variable you want to explore
           feat_three_num) # the feature summarisation you want to perform
#> # A tibble: 144 × 4
#>    country       min   med   max
#>    <chr>       <dbl> <dbl> <dbl>
#>  1 Afghanistan  161.  167.  168.
#>  2 Albania      168.  170.  170.
#>  3 Algeria      166.  169   171.
#>  4 Angola       159.  167.  169.
#>  5 Argentina    167.  168.  174.
#>  6 Armenia      164.  169.  172.
#>  7 Australia    170   172.  178.
#>  8 Austria      162.  167.  179.
#>  9 Azerbaijan   170.  172.  172.
#> 10 Bahrain      161.  164.  164 
#> # ℹ 134 more rows