ds_tailobs | R Documentation |
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. |
Any NA values are stripped from data
before computation takes place.
n
highest/lowest observations from data
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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.