powered by
Returns the n highest/lowest observations from a numeric vector.
ds_tailobs(data, n, type = c("low", "high"), decimals = 2)
n highest/lowest observations from data
n
data
a numeric vector
number of observations to be returned
if low, the n lowest observations are returned, else the highest n observations are returned.
low
An option to specify the exact number of decimal places to use. The default number of decimal places is 2.
Any NA values are stripped from data before computation takes place.
top_n
# 5 lowest observations ds_tailobs(mtcarz$mpg, 5) # 5 highest observations ds_tailobs(mtcarz$mpg, 5, type = "high") # specify decimal places to display ds_tailobs(mtcarz$mpg, 5, decimals = 3)
Run the code above in your browser using DataLab