2018-10-02 21:07:43 +02:00
|
|
|
% Generated by roxygen2: do not edit by hand
|
2019-11-25 12:05:24 +01:00
|
|
|
% Please edit documentation in R/age_calc.R
|
2018-10-02 21:07:43 +02:00
|
|
|
\name{age_calc}
|
|
|
|
\alias{age_calc}
|
|
|
|
\title{Calculating age from date of birth}
|
|
|
|
\usage{
|
|
|
|
age_calc(dob, enddate = Sys.Date(), units = "years", precise = TRUE)
|
|
|
|
}
|
|
|
|
\arguments{
|
2021-03-30 13:31:17 +02:00
|
|
|
\item{dob}{Date of birth. Data format follows standard POSIX layout. Format is yyyy-mm-dd.}
|
2018-10-02 21:07:43 +02:00
|
|
|
|
2021-03-30 13:31:17 +02:00
|
|
|
\item{enddate}{Date to calculate age at. Format is yyyy-mm-dd.}
|
|
|
|
|
|
|
|
\item{units}{Default is "years". Can be changed to "days".}
|
|
|
|
|
|
|
|
\item{precise}{Default is TRUE. Flag set whether to include calculations of spring years. Only of matter if using units = "days".}
|
2018-10-02 21:07:43 +02:00
|
|
|
}
|
|
|
|
\description{
|
|
|
|
For age calculations.
|
|
|
|
}
|
|
|
|
\examples{
|
2021-03-29 08:58:26 +02:00
|
|
|
##Kim Larsen (cpr is known from album)
|
2018-10-04 17:04:15 +02:00
|
|
|
dob<-dob_extract_cpr("231045-0637")
|
2021-03-29 08:58:26 +02:00
|
|
|
date<-as.Date("2018-09-30")
|
2018-10-04 17:04:15 +02:00
|
|
|
trunc(age_calc(dob,date))
|
2018-10-02 21:07:43 +02:00
|
|
|
}
|
|
|
|
\keyword{age}
|