R/prop_value.R

Defines functions prop_value

#' @importFrom dplyr lag
#' @importFrom tibble tibble
#' @importFrom utils tail

prop_value <- function(L){
  props <- L$counts / sum(L$counts)
  labs <- paste0("[", dplyr::lag(L$breaks), ", ", L$breaks, ")")[-1]
  return(tibble(value = labs, prop = props))
}

Try the inspectdf package in your browser

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

inspectdf documentation built on Aug. 9, 2022, 9:05 a.m.