Returns the n highest/lowest observations from a numeric vector.
ds_tailobs(data, n, type = c("low", "high"), decimals = 2)
data | a numeric vector |
---|---|
n | number of observations to be returned |
type | if |
decimals | An option to specify the exact number of decimal places to use. The default number of decimal places is 2. |
n
highest/lowest observations from data
Any NA values are stripped from data
before computation takes place.
# 5 lowest observations ds_tailobs(mtcarz$mpg, 5)#> [1] 10.4 10.4 13.3 14.3 14.7# 5 highest observations ds_tailobs(mtcarz$mpg, 5, type = "high")#> [1] 33.9 32.4 30.4 30.4 27.3# specify decimal places to display ds_tailobs(mtcarz$mpg, 5, decimals = 3)#> [1] 10.4 10.4 13.3 14.3 14.7