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