R/cumulative_in_fractions.R

Defines functions cumulative_in_fractions

Documented in cumulative_in_fractions

#' Cumulative in fractions
#' 
#' Convert cumulative absolute data into cumulative fractions data.
#' @param cumulative_absolute_data A numeric vector of absolute cumulative data.
#' @return A cumulative fraction data
#' @author Alexander Kheirallah ([email protected])
#' @export 

cumulative_in_fractions = function(cumulative_absolute_data){
  cumulative_absolute_data = cumulative_absolute_data[order(cumulative_absolute_data)]
  denominator = cumulative_absolute_data[length(cumulative_absolute_data)]
  cumulative_fractions_data = cumulative_absolute_data/denominator
  return(round(cumulative_fractions_data*100,digits = 2))
}
msxakk89/dat documentation built on April 3, 2020, 5:39 p.m.