R/quantilep.R

Defines functions quantilep

#' @keywords internal
#' @noRd

quantilep <- function(x, perc_str) {
  p <- as.numeric(sub(".*q", "",perc_str))/100
  p_names <- purrr::map_chr(p, ~ paste0("q",.x*100))
  p_funs <- purrr::map(p, ~ purrr::partial(stats::quantile, probs = .x, na.rm = TRUE)) %>%
    purrr::set_names(nm = p_names)
  return(p_funs)
}

Try the ARPALData package in your browser

Any scripts or data that you put into this service are public.

ARPALData documentation built on Sept. 26, 2023, 5:07 p.m.