AMR/man/age.Rd

33 lines
1.2 KiB
Plaintext
Raw Normal View History

2018-12-15 22:40:07 +01:00
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/age.R
\name{age}
\alias{age}
\title{Age in years of individuals}
\usage{
2018-12-22 22:39:34 +01:00
age(x, reference = Sys.Date())
2018-12-15 22:40:07 +01:00
}
\arguments{
2018-12-22 22:39:34 +01:00
\item{x}{date(s), will be coerced with \code{\link{as.POSIXlt}}}
2018-12-15 22:40:07 +01:00
2019-01-12 11:06:58 +01:00
\item{reference}{reference date(s) (defaults to today), will be coerced with \code{\link{as.POSIXlt}} and cannot be lower than \code{x}}
2018-12-15 22:40:07 +01:00
}
\value{
Integer (no decimals)
}
\description{
2019-01-12 11:06:58 +01:00
Calculates age in years based on a reference date, which is the sytem date at default.
2018-12-15 22:40:07 +01:00
}
2019-01-02 23:24:07 +01:00
\section{Read more on our website!}{
\if{html}{\figure{logo.png}{options: height=40px style=margin-bottom:5px} \cr}
2019-01-29 20:20:09 +01:00
On our website \url{https://msberends.gitlab.io/AMR} you can find \href{https://msberends.gitlab.io/AMR/articles/AMR.html}{a comprehensive tutorial} about how to conduct AMR analysis, the \href{https://msberends.gitlab.io/AMR/reference}{complete documentation of all functions} (which reads a lot easier than here in R) and \href{https://msberends.gitlab.io/AMR/articles/WHONET.html}{an example analysis using WHONET data}.
2019-01-02 23:24:07 +01:00
}
2019-01-25 13:18:41 +01:00
\examples{
df <- data.frame(birth_date = Sys.Date() - runif(100) * 25000)
df$age <- age(df$birth_date)
}
2018-12-15 22:40:07 +01:00
\seealso{
2019-01-12 11:06:58 +01:00
\code{\link{age_groups}} to split age into age groups
2018-12-15 22:40:07 +01:00
}