R/eA1c.R

Defines functions eA1c

Documented in eA1c

#' Compute Estimated A1c
#'
#' This function computes the estimated A1c, according to
#' the American Diabetes Association calculator
#'
#' @param df Data frame read through readfile
#' @return A numeric value representing eA1c
#' @examples
#' mydatafile <- system.file("extdata", "my_data_file.csv", package = "cgmquantify")
#' mydata <- readfile(mydatafile)
#' eA1c(mydata)
#' @export

eA1c <- function(df) {
  eA1c = (46.7 + mean(df$glucose))/28.7
  return(eA1c)
}

Try the cgmquantify package in your browser

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

cgmquantify documentation built on Feb. 5, 2021, 9:06 a.m.