Home

Awesome

<!-- README.md is generated from README.Rmd. Please edit that file -->

BirdFlowR <a href="https://birdflow-science.github.io/BirdFlowR/"><img src="man/figures/logo.png" align="right" height="139" /></a>

<!-- badges: start -->

R-CMD-check Codecov test
coverage

<!-- badges: end -->

An R package to predict changes in bird distributions and generate synthetic migration routes based on BirdFlow models.

This package is under development and not yet formally released. Function names and arguments may change.

Installation

Install just the package:

if(!require("remotes"))
  install.packages("remotes") 
remotes::install_github("birdflow-science/BirdFlowR")

Or to install with example data and vignette:

installed <- rownames(installed.packages())
if(!"remotes" %in% installed)
  install.packages("remotes")
if(!"rnaturalearthdata" %in% installed)
  install.packages("rnaturalearthdata")
remotes::install_github("birdflow-science/BirdFlowModels")
remotes::install_github("birdflow-science/BirdFlowR", build_vignettes = TRUE)

See vignette("Installation") for troubleshooting and more installation options.

Usage

The two primary functions are predict() to project distributions and route() to generate synthetic routes.

route_migration() is a wrapper to route() which automates sampling locations from the a distribution for the start of the migration and setting the start and end dates to route for the migration window. We can use it to create synthetic routes for a species.

library(BirdFlowR)
library(BirdFlowModels)

bf <- amewoo 

species(bf)
#> [1] "American Woodcock"

# Generate routes for the prebreeding migration 
rts <- route(bf, n = 10, season = "prebreeding")

# Plot routes
plot_routes(rts, bf)
<img src="man/figures/README-examples-1.png" width="100%" />

Visualize the movement in the BirdFlow model for a timestep.


plot_movement_vectors(bf, start = 12)
<img src="man/figures/README-movement_vectors-1.png" width="100%" />

Learn more