has_overlapping_ts | R Documentation |
The objects that store natural flow data (nfd, crss_nf, or crssi) all
include multiple time series, which are internally stored as xts
objects.
These functions help modify or query the time step component of these
objects.
has_overlapping_ts(x, exact = TRUE)
nfd_trim_ts(x, ...)
## S3 method for class 'xts'
nfd_trim_ts(x, ..., year = "cy")
reindex(x, start_year, master_ts = "monthly")
## S3 method for class 'crssi'
reindex(x, start_year, master_ts = "monthly")
## S3 method for class 'nfd'
reindex(x, start_year, master_ts = "monthly")
## S3 method for class 'xts'
reindex(x, start_year, ...)
x |
An object inheriting from nfd, crss_nf, or crssi. |
exact |
Boolean. Do the annual and monthly data have to overlap "exactly". See Details. |
... |
Other parameters passed to function. Ignored if |
year |
"cy" or "wy" to specify calendar or water year, respectively. |
start_year |
The new starting year as a string or numeric. |
master_ts |
Ignored unless |
has_overlapping_ts()
determines whether the the annual and monthly data
within the object are overlapping. If exact
is TRUE
, the start and end
time step for the monthly and annual data must match "exactly". This means for
an object storing calendar year data that the monthly data will start in
January, year1 and end in December, year2 while the annual data must start
in December, year1 and end in December, year2. The analogous is true for
water year data, except the start and end months are October and September,
respectively.
If the object contains only monthly, or only annual data,
has_overlapping_ts()
will always return TRUE.
nfd_trim_ts()
trims the object so that it only contains an "exact"
overlapping set of monthly data, that is it starts and ends in
January and December for calendar year data or October and September for
water year data. Additionally, if object contains annual and monthly data,
those data are trimmed to only include data for the same years. If the object
only includes annual data, no trimming is performed.
reindex()
changes the time steps, i.e., indeces, of natural flow data as
stored in nfd, crss_nf, or crssi objects. The time steps are changed
to start in the specified start_year
. This change applies to all time
series data stored in the object, i.e., monthly and annual data and
the Sacramento year type.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.