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 #' @keywords age
#' @export #' @export
#' @examples #' @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) age_calc<-function (dob, enddate = Sys.Date(), units = "years", precise = TRUE)
## Build upon the work of Jason P. Becker, as part of tihe eeptools ## Build upon the work of Jason P. Becker, as part of tihe eeptools

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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