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
.
emr_monthly_iterator(stime, etime = NULL, n = NULL)
emr_yearly_iterator(stime, etime = NULL, n = NULL)
the date of the first point in machine format (use emr_date2time
)
end of time scope (can be NULL
if months
parameter is set)
number of months / years
an id time data frame that can be used as an iterator
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)
#> [1] id time ref dense_track
#> <0 rows> (or 0-length row.names)
iter <- emr_monthly_iterator(emr_date2time(1, 1, 2002), n = 15)
emr_extract("dense_track", iterator = iter, stime = 1, etime = 3)
#> [1] id time ref dense_track
#> <0 rows> (or 0-length row.names)