emr_monthly_iterator {naryn} | R Documentation |
Create an iterator that goes every year/month
Description
Create an iterator that goes every year/month, from stime
.
If etime
is set, the iterator would go every year/month until the last point which is <= etime
.
If month
or years
is set, the iterator would be set for every year/month
n
times.
If both parameters are set, the iterator would go from etime
until the early between n
times and etime
.
Usage
emr_monthly_iterator(stime, etime = NULL, n = NULL)
emr_yearly_iterator(stime, etime = NULL, n = NULL)
Arguments
stime |
the date of the first point in machine format (use |
etime |
end of time scope (can be |
n |
number of months / years |
Value
an id time data frame that can be used as an iterator
Examples
iter <- emr_monthly_iterator(emr_date2time(1, 1, 2002), emr_date2time(1, 1, 2017))
# note that the examples database doesn't include actual dates, so the results are empty
emr_extract("dense_track", iterator = iter, stime = 1, etime = 3)
iter <- emr_monthly_iterator(emr_date2time(1, 1, 2002), n = 15)
emr_extract("dense_track", iterator = iter, stime = 1, etime = 3)
[Package naryn version 2.6.26 Index]