MazamaScience/MazamaCoreUtils

add timeRange() function

Closed this issue · 0 comments

We should have a timeRange() function that works similarly to dateRange() but allows for the specification of boundaries at units smaller than "day".

I imagine someone might want to ask for:

  • last 10 hours of data with hour boundaries -- endtime = lubridate::now(), seconds = 10*3600, unit = "hour"
  • 3 day's worth of minute resolution starting and ending at 1am -- starttime = 2019060401, seconds = 3*24*3600, unit = "minute"
  • precise, second resolution starttime and endtime -- starttime = "2019-06-05 07:18:32", endtame = "2019-06-05 12:21:20", unit = "sec"

Arguments should probably be:

  • starttime
  • endtime
  • seconds
  • timezone
  • unit