Learn R Programming

descriptr (version 0.6.1)

ds_extreme_obs: Extreme observations

Description

Returns the most extreme observations and their original row indices.

Usage

ds_extreme_obs(data, col, decimals = 2)

Arguments

data

A numeric vector or data.frame or tibble.

col

Column in data.

decimals

An option to specify the exact number of decimal places to use. The default number of decimal places is 2.

Details

Missing values are removed before the k = min(5, n) lowest and highest observations are selected. The row indices refer to the data passed in, and ties are reported on distinct rows. decimals applies to both vector and data.frame input.

Examples

Run this code
# data.frame
ds_extreme_obs(mtcarz, mpg)

# vector
ds_extreme_obs(mtcarz$mpg)

# decimal places
ds_extreme_obs(mtcarz$mpg, decimals = 3)

Run the code above in your browser using DataLab