mirror of
https://github.com/msberends/AMR.git
synced 2025-09-02 22:24:07 +02:00
new, automated website
This commit is contained in:
24
man/age.Rd
24
man/age.Rd
@@ -21,34 +21,26 @@ age(x, reference = Sys.Date(), exact = FALSE, na.rm = FALSE, ...)
|
||||
An \link{integer} (no decimals) if \code{exact = FALSE}, a \link{double} (with decimals) otherwise
|
||||
}
|
||||
\description{
|
||||
Calculates age in years based on a reference date, which is the sytem date at default.
|
||||
Calculates age in years based on a reference date, which is the system date at default.
|
||||
}
|
||||
\details{
|
||||
Ages below 0 will be returned as \code{NA} with a warning. Ages above 120 will only give a warning.
|
||||
|
||||
This function vectorises over both \code{x} and \code{reference}, meaning that either can have a length of 1 while the other argument has a larger length.
|
||||
}
|
||||
\section{Stable Lifecycle}{
|
||||
|
||||
\if{html}{\figure{lifecycle_stable.svg}{options: style=margin-bottom:"5"} \cr}
|
||||
The \link[=lifecycle]{lifecycle} of this function is \strong{stable}. In a stable function, major changes are unlikely. This means that the unlying code will generally evolve by adding new arguments; removing arguments or changing the meaning of existing arguments will be avoided.
|
||||
|
||||
If the unlying code needs breaking changes, they will occur gradually. For example, an argument will be deprecated and first continue to work, but will emit a message informing you of the change. Next, typically after at least one newly released version on CRAN, the message will be transformed to an error.
|
||||
}
|
||||
|
||||
\section{Read more on Our Website!}{
|
||||
|
||||
On our website \url{https://msberends.github.io/AMR/} you can find \href{https://msberends.github.io/AMR/articles/AMR.html}{a comprehensive tutorial} about how to conduct AMR data analysis, the \href{https://msberends.github.io/AMR/reference/}{complete documentation of all functions} and \href{https://msberends.github.io/AMR/articles/WHONET.html}{an example analysis using WHONET data}.
|
||||
}
|
||||
|
||||
\examples{
|
||||
# 10 random birth dates
|
||||
df <- data.frame(birth_date = Sys.Date() - runif(10) * 25000)
|
||||
# 10 random pre-Y2K birth dates
|
||||
df <- data.frame(birth_date = as.Date("2000-01-01") - runif(10) * 25000)
|
||||
|
||||
# add ages
|
||||
df$age <- age(df$birth_date)
|
||||
|
||||
# add exact ages
|
||||
df$age_exact <- age(df$birth_date, exact = TRUE)
|
||||
|
||||
# add age at millenium switch
|
||||
df$age_at_y2k <- age(df$birth_date, "2000-01-01")
|
||||
|
||||
df
|
||||
}
|
||||
\seealso{
|
||||
|
Reference in New Issue
Block a user