raws_filterDate: Date filtering for _raws_timeseries_ objects

View source: R/raws_filterDate.R

raws_filterDateR Documentation

Date filtering for raws_timeseries objects

Description

Subsets a raws_timeseries object by date. This function always filters to day-boundaries.

Dates can be anything that is understood by lubridate::ymd() including either of the following recommended formats:

  • "YYYYmmdd"

  • "YYYY-mm-dd"

Usage

raws_filterDate(
  rawsObject = NULL,
  startdate = NULL,
  enddate = NULL,
  timezone = NULL,
  unit = "sec",
  ceilingStart = FALSE,
  ceilingEnd = FALSE
)

Arguments

rawsObject

raws_timeseries object.

startdate

Desired start datetime (ISO 8601).

enddate

Desired end datetime (ISO 8601).

timezone

Olson timezone used to interpret dates.

unit

Units used to determine time at end-of-day.

ceilingStart

Logical instruction to apply ceiling_date to the startdate rather than floor_date

ceilingEnd

Logical instruction to apply ceiling_date to the enddate rather than floor_date

Value

A subset of the given raws_timeseries object.

Note

The returned data will run from the beginning of startdate until the beginning of enddatei.e. no values associated with enddate will be returned. The exception being when enddate is less than 24 hours after startdate. In that case, a single day is returned.

See Also

raws_filter

Examples


library(RAWSmet)

data201708 <-
  example_cefa_Saddle_Mountain %>%
  raws_filterDate(20170801, 20170901, timezone = "America/Los_Angeles")

head(data201708$data)



MazamaScience/RAWSmet documentation built on May 6, 2023, 6:57 a.m.