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_coordare NULL). Generate this many samples. Otherwise thex_coordandy_coordpositions will each be duplicatedntimes.- x_coord, y_coord
Optional, if
NULLstarting 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 toTRUEto sample from distributions derived from the fitted model parameters stored in the marginals. Passed toget_distr().- ...
Arguments passed on to
lookup_timestep_sequenceseasona season name, season alias, or "all". See
lookup_season_timesteps()for options.startThe starting point in time specified as a timestep, character date, or date object.
endThe ending point in time as a date or timestep.
directionEither "forward" or "backward" defaults to
"forward"if not processing dates. If using date inputdirectionis optional and is only used to verify the direction implicit in the dates.season_bufferOnly used with
seasoninput.season_bufferis passed tolookup_season_timesteps()and defaults to 1; it is the number of timesteps to extend the season by at each end.n_stepsAlternative to
endThe end will ben_stepsaway fromstartindirection; and the resulting sequence will haven_steptransitions andn_steps + 1timesteps.
Value
A BirdFlowRoutes object with columns:
x,yCoordinates of point along route.
dateDate associated with that point.
timestepTimestep associated with point.
routeUnique ID for that route or individual.
iLocation index for the point (see
i_to_xy()).stay_idWithin each route a sequential id for locations.
stay_lenHow many timesteps was the Bird at that point during the stay (minimum of 1).
It also has experimental attributes:
geom,species,datesThe
geom,species, anddatescomponents of the BirdFlow object the routes are derived from.metadataThe
metadatacomponent 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)
} # }
