quantiles {tabulator}R Documentation

Efficient quantiles

Description

Produces quantiles of the variables. quantiles shows quantile values. Efficient with big data: if you give it a data.table, quantiles uses data.table syntax.

Usage

quantiles(df, ..., probs = seq(0, 1, 0.1), na.rm = FALSE)

Arguments

df

A data.table, tibble, or data.frame.

...

A column or set of columns (without quotation marks).

probs

numeric vector of probabilities with values in [0,1].

na.rm

logical; if true, any NA and NaN's are removed from x before the quantiles are computed.

Value

Quantile values.

Examples

# data.table
library(data.table)
library(magrittr)
a <- data.table(varname = sample.int(20, size = 1000000, replace = TRUE))
a %>% quantiles(varname)

# data.table: look at top 10% in more detail
a %>% quantiles(varname, probs = seq(0.9, 1, 0.01))

# tibble
library(dplyr)
b <- tibble(varname = sample.int(20, size = 1000000, replace = TRUE))
b %>% quantiles(varname, na.rm = TRUE)


[Package tabulator version 1.0.0 Index]