Learn R Programming

descriptr (version 0.5.2)

ds_tailobs: Tail Observations

Description

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

Usage

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.

See Also

top_n

Examples

Run this code
# NOT RUN {
ds_tailobs(mtcarz$mpg, 5)
ds_tailobs(mtcarz$mpg, 5, type = "high")
# }

Run the code above in your browser using DataLab