calc_quantiles: Calculate quantiles of a tidy dataframe

Description Usage Arguments Value Examples

View source: R/stat_interval.R

Description

Calculate quantiles of a tidy dataframe

Usage

1
calc_quantiles(data, intervals, x_var = "x", y_var = "y", rename = T)

Arguments

data

A data frame with containing x and y columns, with several y values for every x

intervals

A list of intervals for which corresponding quantiles are desired.

x_var

A character string giving the name of the x variable

y_var

A character string giving the name of the y variable

rename

Logical. Indicates whether to retain existing variable name or use x and y.

Value

A data frame containing x, y, and quantile columns (possibly renamed)

Examples

1
2
3
4
head(fake_df)

fake_q <- calc_quantiles(fake_df, intervals=c(0,0.5,0.8))
head(fake_q)

ggfan documentation built on May 2, 2019, 4:04 a.m.