Returns the n highest/lowest observations from a numeric vector.

ds_tailobs(data, n, type = c("low", "high"))

Arguments

data

a numeric vector

n

number of observations to be returned

type

if low, the n lowest observations are returned, else the highest n obervations are returned

Value

n highest/lowest observations from data

Details

Any NA values are stripped from data before computation takes place.

Deprecated function

tailobs() has been deprecated. Instead use ds_tailobs().

See also

Examples

ds_tailobs(mtcarz$mpg, 5)
#> [1] 10.4 10.4 13.3 14.3 14.7
ds_tailobs(mtcarz$mpg, 5, type = "high")
#> [1] 33.9 32.4 30.4 30.4 27.3