knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>",
  fig.path = "man/figures/README-",
  out.width = "100%"
)

AUCtrap: AUC calculation using the trapezoidal rule

The goal of the AUCtrap package is to provide utilities for calculating the area under the curve for longitudinal measurements.

Installation

You can install the development version of AUCtrap from GitHub with:

# install.packages("devtools")
devtools::install_github("anikoszabo/AUCtrap")

Example

This is a basic example which shows you how to solve a common problem:

library(AUCtrap)
AUCtrap(0:3, c(3,4,1,2))
AUCtrap(0:3, c(3,4,1,2), method="iAUC")
AUCtrap(0:3, c(3,4,1,2), method="minAUC")

A formula can be used:

dd <- data.frame(Time = 0:4, Value = c(3,4,1,2,10))
AUCtrap(Value ~ Time, data=dd)

ex2 <- AUCtrap(0:3, c(3,4,1,2), method="iAUC")
ex2
plot(ex2)

ex.min <- AUCtrap(0:3, c(3,4,1,2), method="minAUC")
plot(ex.min)
AUCtrap(Value ~ Time, data=dd, subset=Time < 4, method="minAUC")


anikoszabo/AUCtrap documentation built on Dec. 19, 2021, 3:37 a.m.