Calculate quantiles of a tidy dataframe
calc_quantiles(data, intervals, x_var = "x", y_var = "y", rename = T)
A data frame with containing x and y columns, with several y values for every x
A list of intervals for which corresponding quantiles are desired.
A character string giving the name of the x variable
A character string giving the name of the y variable
Logical. Indicates whether to retain existing variable name or use x and y.
x
y
A data frame containing x, y, and quantile columns (possibly renamed)
# NOT RUN { head(fake_df) fake_q <- calc_quantiles(fake_df, intervals=c(0,0.5,0.8)) head(fake_q) # }
Run the code above in your browser using DataLab