Description Usage Arguments Value Author(s) Examples
View source: R/summary_functions.R
This function calculates the respective quantile value depending on the probability value defined. It also allows flexible missing values definition.
1 | summary_quantile(x, na.rm = FALSE, probs, na_type = "", ...)
|
x |
A numeric vector. |
na.rm |
A logical value indicating whether missing values should be stripped before the computation proceeds. |
probs |
A numeric vector of probability values between '0' and '1'. |
na_type |
A vector of strings that defines the type of missing value criteria e.g "n", "con", "prop", "FUN". |
... |
Additional parameters that could be passed internally. for example 'na_consecutive_n = 3' to define the maximum allowed number of consecutive missing values. Other parameters include "na_max_n", "na_min_n", "n_non_miss", "na_max_prop" for maximum, minimum and proportion of missing values. |
Returns the quantile value.
Shadrack Kibet
1 2 3 | x <- c(1:10, NA, NA, NA, 2, 5, 6, 7)
summary_quantile(x, na.rm = TRUE, na_type = "n", na_max_n = 3, probs = 0.25) # lower quartile
summary_quantile(x, na.rm = TRUE, na_type = "con", na_consecutive_n = 3, probs = 0.75) # upper quartile
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.