ds_tailobs {descriptr} | R Documentation |
Tail Observations
Description
Returns the n highest/lowest observations from a numeric vector.
Usage
ds_tailobs(data, n, type = c("low", "high"), decimals = 2)
Arguments
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. |
Details
Any NA values are stripped from data
before computation takes place.
Value
n
highest/lowest observations from data
See Also
Examples
# 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)
[Package descriptr version 0.6.0 Index]