mirror of
https://github.com/agdamsbo/stRoke.git
synced 2024-11-22 21:10:23 +01:00
31 lines
854 B
Plaintext
31 lines
854 B
Plaintext
|
% Generated by roxygen2: do not edit by hand
|
||
|
% Please edit documentation in R/age_calc.R
|
||
|
\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{
|
||
|
\item{dob}{Date of birth. Data format follows standard POSIX layout. Format is yyyy-mm-dd.}
|
||
|
|
||
|
\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".}
|
||
|
}
|
||
|
\value{
|
||
|
Vector of age
|
||
|
}
|
||
|
\description{
|
||
|
For age calculations. Vectorised.
|
||
|
}
|
||
|
\examples{
|
||
|
# Kim Larsen (cpr is known from album)
|
||
|
dob<-daDoctoR::dob_extract_cpr("231045-0637")
|
||
|
date<-as.Date("2018-09-30")
|
||
|
trunc(age_calc(dob,date))
|
||
|
}
|
||
|
\keyword{age}
|