This function returns the timestep or timesteps associated with x
in a
particular BirdFlow model, where x
represents dates or timesteps in
various formats.
Arguments
- x
A character object representing date as year-month-day e.g. "2023-03-29", date object (
Date
,POSIXct
, orPOSIXlt
), a numeric timestep, a character representing a timestep e.g. "t1", or "all" for all timesteps in the model.- bf
A BirdFlow object.
- allow_failure
If TRUE function will return NA values when it fails to resolve a timestep for any element of
x
. With the default, FALSE, the function will throw an error if not all elements ofx
are resolved to timesteps.
Details
So far all BirdFlow objects have had timesteps corresponding with weeks of the year and matching the S&T timesteps. However, it is likely that we will add the ability to make BirdFlow objects that only model part of the year. If we do this the timestep values will not necessarily match weeks. For example a model that covers Week 6, to 20 would have timesteps from 1 to 15.
If x
is numeric it is assumed to already be a timestep. This is useful
when using this function internally to resolve arguments to other
functions like route()
, predict()
, and get_distr()
.