route()
projects bird positions over time based on the probabilities
embedded in a BirdFlow model. The output is linear, stochastic routes.
Arguments
- bf
A BirdFlow object.
- n
If sampling starting positions (
x_coord
, andy_coord
are NULL). Generate this many samples. Otherwise thex_coord
andy_coord
positions will each be duplicatedn
times.- x_coord, y_coord
Optional, if
NULL
starting points will be drawn from the species distribution at the initial timestep.- from_marginals
Use
FALSE
(the default) to use distributions derived directly from eBird Status and Trends when sampling starting locations. Set toTRUE
to sample from distributions derived from the fitted model parameters stored in the marginals. Passed toget_distr()
.- ...
Arguments passed on to
lookup_timestep_sequence
season
a season name, season alias, or "all". See
lookup_season_timesteps()
for options.start
The starting point in time specified as a timestep, character date, or date object.
end
The ending point in time as a date or timestep.
direction
Either "forward" or "backward" defaults to
"forward"
if not processing dates. If using date inputdirection
is optional and is only used to verify the direction implicit in the dates.season_buffer
Only used with
season
input.season_buffer
is passed tolookup_season_timesteps()
and defaults to 1; it is the number of timesteps to extend the season by at each end.n_steps
Alternative to
end
The end will ben_steps
away fromstart
indirection
; and the resulting sequence will haven_step
transitions andn_steps + 1
timesteps.
Value
A BirdFlowRoutes object with columns:
x
,y
Coordinates of point along route.
date
Date associated with that point.
timestep
Timestep associated with point.
route
Unique ID for that route or individual.
i
Location index for the point (see
i_to_xy()
).stay_id
Within each route a sequential id for locations.
stay_len
How many timesteps was the Bird at that point during the stay (minimum of 1).
It also has experimental attributes:
geom
,species
,dates
The
geom
,species
, anddates
components of the BirdFlow object the routes are derived from.metadata
The
metadata
component of the parent BirdFlow object, with one additional itemroute_type = "synthetic"
.
Examples
bf <- BirdFlowModels::amewoo
rts <- route(bf, 10, season = "prebreeding")
if (FALSE) { # \dontrun{
plot_routes(rts)
} # }