gestAge: Calculate Gestational Age

Description Usage Arguments Details Author(s) Source Examples

View source: R/gestAge.R

Description

Calculate the gestational age of a child or fetus based on the estimated date of confinement (or estimated date of delivery).

Usage

1
gestAge(edc, adc, result = c("both", "week", "day"))

Arguments

edc

The estimated date of confinement (sometimes called the estimated date of delivery). Must be an object suitable for the difftime function (such as Date, POSIXct, etc.) or the calculation will fail.

adc

The date for which the gestational age needs to be calcualted. This may be the current date, the date of a prenatal care visit, or the actual date of delivery. As with edc, this must be an object suitable for difftime.

result

A character option that determines the nature of the result returned. "both" returns a character string in the format "[weeks]/[days]"; "week" returns the integer value of the weeks component; "day" returns the integer value of the days component.

Details

Gestational age is commonly reported as [weeks]/[days] where [weeks] is an integer between 0 and 42 (though in some cases is may be larger), and days is an integer between 0 and 6. Thus, 39/2 is 39 weeks and 2 days into pregnancy. The commonly accepted standard length of pregnancy is 40 weeks.

Author(s)

Benjamin Nutter

Source

http://www.acog.org/-/media/Departments/Patient-Safety-and-Quality-Improvement/201213IssuesandRationale-GestationalAgeTerm.pdf

Examples

1
2
3
4
5
edc <- as.Date(c("6/18/2010", "10/22/2010"), format="%m/%d/%Y")
adc <- as.Date(c("5/22/2010", "10/18/2010"), format="%m/%d/%Y")
gestAge(edc, adc, "both")
gestAge(edc, adc, "week")
gestAge(edc, adc, "day")

nutterb/Bluegrass documentation built on May 24, 2019, 10:50 a.m.