Returns the most extreme observations.
ds_extreme_obs(data, col, decimals = 2)
data | A numeric vector or |
---|---|
col | Column in |
decimals | An option to specify the exact number of decimal places to use. The default number of decimal places is 2. |
# data.frame ds_extreme_obs(mtcarz, mpg)#> # A tibble: 10 x 3 #> type value index #> <chr> <dbl> <int> #> 1 high 33.9 20 #> 2 high 32.4 18 #> 3 high 30.4 19 #> 4 high 30.4 28 #> 5 high 27.3 26 #> 6 low 10.4 15 #> 7 low 10.4 16 #> 8 low 13.3 24 #> 9 low 14.3 7 #> 10 low 14.7 17# vector ds_extreme_obs(mtcarz$mpg)#> type value index #> 1 high 33.9 20 #> 2 high 32.4 18 #> 3 high 30.4 19 #> 4 high 30.4 28 #> 5 high 27.3 26 #> 6 low 10.4 15 #> 7 low 10.4 16 #> 8 low 13.3 24 #> 9 low 14.3 7 #> 10 low 14.7 17# decimal places ds_extreme_obs(mtcarz$mpg, decimals = 3)#> type value index #> 1 high 33.9 20 #> 2 high 32.4 18 #> 3 high 30.4 19 #> 4 high 30.4 28 #> 5 high 27.3 26 #> 6 low 10.4 15 #> 7 low 10.4 16 #> 8 low 13.3 24 #> 9 low 14.3 7 #> 10 low 14.7 17