edit age_calc

This commit is contained in:
AG Damsbo 2022-09-22 19:57:12 +02:00
parent 7321e2d8a9
commit 2a86a2f051
5 changed files with 5 additions and 5 deletions

View File

@ -12,7 +12,7 @@
#' #'
#' @examples #' @examples
#' # Kim Larsen (cpr is known from album) #' # Kim Larsen (cpr is known from album)
#' dob<-daDoctoR::dob_extract_cpr("231045-0637") #' dob<-as.Date("1945-10-23")
#' date<-as.Date("2018-09-30") #' date<-as.Date("2018-09-30")
#' trunc(age_calc(dob,date)) #' trunc(age_calc(dob,date))

View File

@ -2,5 +2,5 @@ pandoc: 2.19.2
pkgdown: 2.0.6 pkgdown: 2.0.6
pkgdown_sha: ~ pkgdown_sha: ~
articles: {} articles: {}
last_built: 2022-09-22T17:52Z last_built: 2022-09-22T17:56Z

View File

@ -73,7 +73,7 @@
<div class="section level2"> <div class="section level2">
<h2 id="ref-examples">Examples<a class="anchor" aria-label="anchor" href="#ref-examples"></a></h2> <h2 id="ref-examples">Examples<a class="anchor" aria-label="anchor" href="#ref-examples"></a></h2>
<div class="sourceCode"><pre class="sourceCode r"><code><span class="r-in"><span><span class="co"># Kim Larsen (cpr is known from album)</span></span></span> <div class="sourceCode"><pre class="sourceCode r"><code><span class="r-in"><span><span class="co"># Kim Larsen (cpr is known from album)</span></span></span>
<span class="r-in"><span> <span class="va">dob</span><span class="op">&lt;-</span><span class="fu">daDoctoR</span><span class="fu">::</span><span class="fu"><a href="https://rdrr.io/pkg/daDoctoR/man/dob_extract_cpr.html" class="external-link">dob_extract_cpr</a></span><span class="op">(</span><span class="st">"231045-0637"</span><span class="op">)</span></span></span> <span class="r-in"><span> <span class="va">dob</span><span class="op">&lt;-</span><span class="fu"><a href="https://rdrr.io/r/base/as.Date.html" class="external-link">as.Date</a></span><span class="op">(</span><span class="st">"1945-10-23"</span><span class="op">)</span></span></span>
<span class="r-in"><span> <span class="va">date</span><span class="op">&lt;-</span><span class="fu"><a href="https://rdrr.io/r/base/as.Date.html" class="external-link">as.Date</a></span><span class="op">(</span><span class="st">"2018-09-30"</span><span class="op">)</span></span></span> <span class="r-in"><span> <span class="va">date</span><span class="op">&lt;-</span><span class="fu"><a href="https://rdrr.io/r/base/as.Date.html" class="external-link">as.Date</a></span><span class="op">(</span><span class="st">"2018-09-30"</span><span class="op">)</span></span></span>
<span class="r-in"><span> <span class="fu"><a href="https://rdrr.io/r/base/Round.html" class="external-link">trunc</a></span><span class="op">(</span><span class="fu">age_calc</span><span class="op">(</span><span class="va">dob</span>,<span class="va">date</span><span class="op">)</span><span class="op">)</span></span></span> <span class="r-in"><span> <span class="fu"><a href="https://rdrr.io/r/base/Round.html" class="external-link">trunc</a></span><span class="op">(</span><span class="fu">age_calc</span><span class="op">(</span><span class="va">dob</span>,<span class="va">date</span><span class="op">)</span><span class="op">)</span></span></span>
<span class="r-out co"><span class="r-pr">#&gt;</span> [1] 72</span> <span class="r-out co"><span class="r-pr">#&gt;</span> [1] 72</span>

File diff suppressed because one or more lines are too long

View File

@ -23,7 +23,7 @@ For age calculations. Vectorised.
} }
\examples{ \examples{
# Kim Larsen (cpr is known from album) # Kim Larsen (cpr is known from album)
dob<-daDoctoR::dob_extract_cpr("231045-0637") dob<-as.Date("1945-10-23")
date<-as.Date("2018-09-30") date<-as.Date("2018-09-30")
trunc(age_calc(dob,date)) trunc(age_calc(dob,date))
} }