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"
raws_filterDate(
rawsObject = NULL,
startdate = NULL,
enddate = NULL,
timezone = NULL,
unit = "sec",
ceilingStart = FALSE,
ceilingEnd = FALSE
)
raws_timeseries object.
Desired start datetime (ISO 8601).
Desired end datetime (ISO 8601).
Olson timezone used to interpret dates.
Units used to determine time at end-of-day.
Logical instruction to apply
ceiling_date
to the startdate
rather than
floor_date
Logical instruction to apply
ceiling_date
to the enddate
rather than
floor_date
A subset of the given raws_timeseries object.
The returned data will run from the beginning of startdate
until
the beginning of enddate
-- i.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.
# \donttest{
library(RAWSmet)
data201708 <-
example_cefa_Saddle_Mountain %>%
raws_filterDate(20170801, 20170901, timezone = "America/Los_Angeles")
head(data201708$data)
#> # A tibble: 6 × 12
#> datetime temperature humidity windSpeed windDirection maxGustSpeed
#> <dttm> <dbl> <dbl> <dbl> <dbl> <dbl>
#> 1 2017-08-01 07:00:00 20.6 36.5 1.34 281 3.58
#> 2 2017-08-01 08:00:00 20 36.5 2.68 290 3.58
#> 3 2017-08-01 09:00:00 23.9 36.5 4.02 232 4.92
#> 4 2017-08-01 10:00:00 23.3 36.5 3.13 248 5.36
#> 5 2017-08-01 11:00:00 22.2 36.5 3.58 232 4.92
#> 6 2017-08-01 12:00:00 22.8 36.5 3.58 242 5.36
#> # ℹ 6 more variables: maxGustDirection <dbl>, precipitation <dbl>,
#> # solarRadiation <dbl>, fuelMoisture <dbl>, fuelTemperature <chr>,
#> # monitorType <chr>
# }