This commit is contained in:
agdamsbo 2018-10-04 17:04:15 +02:00
parent 8be45013f1
commit cc48f5cac4
8 changed files with 50 additions and 44 deletions

View File

@ -6,7 +6,10 @@
#' @keywords age
#' @export
#' @examples
#' age_calc()
#' ##Kim Larsen
#' dob<-dob_extract_cpr("231045-0637")
#' date<-as.Date("2018-09-29")
#' trunc(age_calc(dob,date))
age_calc<-function (dob, enddate = Sys.Date(), units = "years", precise = TRUE)
## Build upon the work of Jason P. Becker, as part of tihe eeptools

View File

@ -5,7 +5,7 @@
#' @keywords cpr
#' @export
#' @examples
#' cpr_check()
#' cpr_check("231045-0637")
cpr_check<-function(x){
#Check validity of CPR number, format ddmmyy-xxxx

View File

@ -5,7 +5,7 @@
#' @keywords cpr
#' @export
#' @examples
#' cpr_sex()
#' cpr_sex("231045-0637")
cpr_sex<-function(x){
##Input as vector of DK cpr numbers, format "ddmmyy-xxxx", returns sex according to cpr

View File

@ -5,7 +5,7 @@
#' @keywords cpr
#' @export
#' @examples
#' dob_extract_cpr()
#' dob_extract_cpr("231045-0637")
dob_extract_cpr<-function(cpr)

View File

@ -15,6 +15,9 @@ age_calc(dob, enddate = Sys.Date(), units = "years", precise = TRUE)
For age calculations.
}
\examples{
age_calc()
##Kim Larsen
dob<-dob_extract_cpr("231045-0637")
date<-as.Date("2018-09-29")
trunc(age_calc(dob,date))
}
\keyword{age}

View File

@ -13,6 +13,6 @@ cpr_check(x)
Checking validity of cpr number
}
\examples{
cpr_check()
cpr_check("231045-0637")
}
\keyword{cpr}

View File

@ -13,6 +13,6 @@ cpr_sex(x)
Format "ddmmyy-xxxx"
}
\examples{
cpr_sex()
cpr_sex("231045-0637")
}
\keyword{cpr}

View File

@ -13,6 +13,6 @@ dob_extract_cpr(cpr)
For easy calculation.
}
\examples{
dob_extract_cpr()
dob_extract_cpr("231045-0637")
}
\keyword{cpr}