R/p_percent.R

Defines functions p_percent

Documented in p_percent

#' Parse percent value
#' 
#' @param x character; a value that can be coerced to a character that has a 
#' percentage sign at the end
#' 
#' @details 
#' 
#' Returns numeric value with the percentage sign stripped
#' 
#' @import stringr
#' @export

p_percent <- function(x){
  
  gsub( "\\%$", "", x ) %>% as.numeric()
  
}
decisionpatterns/coercion documentation built on Nov. 4, 2019, 10:23 a.m.