integrate_area: Integrate area

Description Usage Arguments Value

View source: R/integrate_area.R

Description

Integrate the area under a xy plot. Credit to StackOverflow The method used here is to sum the area of mutiple trapeziums under a line.

Usage

1
integrate_area(df, x, y, skip.na = TRUE)

Arguments

df

Data frame containing x and y of a plot.

x

Column name for the x axis.

y

Column name for the y axis.

skip.na

Logical. How to treat NAs in y. If TRUE the trapezium of the area adjacent to the missing value will be calculated. If FALSE the two trapeziums before and after the missing value will be NA.

Value

A value of the area.


MohoWu/ricardor documentation built on March 6, 2021, 4:17 p.m.