View source: R/add_risk_quantiles.R
1 2 3 4 5 6 7 8 9 | add_risk_quantiles(
d,
risk.col,
output.col = risk.col,
quants = 5,
highest.number.is.worst = TRUE,
style = "fisher",
samp_prop = 1
)
|
d |
The data |
risk.col |
String specifying the name of the column to quantise |
output.col |
String specifying the name of the column to add (defaults to the same as risk.col) |
quants |
Number of quantiles (default: 5) |
highest.number.is.worst |
Should a risk score of 1 represent the highest number in the data (TRUE) or the lowest (FALSE)? |
style |
Method to use for calculating quantiles (passed to classIntervals; default: Fisher). One of "fixed", "sd", "equal", "pretty", "quantile", "kmeans", "hclust", "bclust", "fisher", "jenks" or "dpih" |
samp_prop |
The proportion of samples to use, if slicing using "fisher" or "jenks" (passed to classIntervals; default: 100 |
A dataframe with two columns added: one for the risk quantile (output.col_q) and one containing labels for the risk quantile (output.col_q_name) Add risk quantiles to a dataframe for the given column.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.