Skip to content

Commit

Permalink
Updated installation instructions and readme
Browse files Browse the repository at this point in the history
  • Loading branch information
ethanplunkett committed Feb 27, 2023
1 parent 3885c69 commit 964a62f
Show file tree
Hide file tree
Showing 3 changed files with 71 additions and 59 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Package: BirdFlowR
Title: Forecast and Visualize Bird Movement
Version: 0.0.0.9002
Version: 0.0.0.9003
Authors@R:
c(person("Ethan", "Plunkett", email = "plunkett@umass.edu", role = c("aut", "cre"),
comment = c(ORCID = "0000-0003-4405-2251")),
Expand Down
6 changes: 6 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
# BirdFlowR 0.0.0.9003 2023-02-27

* Updated installation instructions. Closing [#11](https://github.com/birdflow-science/BirdFlowR/issues/11).

* Added docker file. [Usage instructions.](https://github.com/birdflow-science/BirdFlowR/pull/15#issuecomment-1445152787)

# BirdFlowR 0.0.0.9002 2023-02-23

* Added "biocViews:" before "Imports:" in DESCRIPTION so that devtools can find
Expand Down
122 changes: 64 additions & 58 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,58 +1,64 @@
# BirdFlowR

<!-- badges: start -->
[![R-CMD-check](https://github.com/birdflow-science/BirdFlowR/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/birdflow-science/BirdFlowR/actions/workflows/R-CMD-check.yaml)
[![Codecov test coverage](https://codecov.io/gh/birdflow-science/BirdFlowR/branch/main/graph/badge.svg)](https://app.codecov.io/gh/birdflow-science/BirdFlowR?branch=main)
<!-- badges: end -->

An R package to forecast changes in 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 the package and the accompanying data package from github:
```{r}
devtools::install_github("birdflow-science/BirdFlowModels") # data package
devtools::install_github("birdflow-science/BirdFlowR", build_vignettes = TRUE)
```

## Usage

The two primary functions are `forecast()` 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.
```{r}
library(BirdFlowR)
library(BirdFlowModels)
library(terra)
bf <- amewoo
species(bf)
# start migration at end of the nonbreeding season
start <- species_info(bf, "nonbreeding_end")
# Retreive starting distribution as a SpatRaster and plot
r <- rast(bf, start)
plot(r)
# Generate migration routes
rts <- route_migration(bf, 10, "prebreeding")
# Add lines to plot
plot(rts$lines, add = TRUE, col = rgb(0, 0, 0, .25))
```

## Learn more

Read `vignette("BirdFlowR")` for a longer introduction to the package.


# BirdFlowR

<!-- badges: start -->
[![R-CMD-check](https://github.com/birdflow-science/BirdFlowR/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/birdflow-science/BirdFlowR/actions/workflows/R-CMD-check.yaml)
[![Codecov test coverage](https://codecov.io/gh/birdflow-science/BirdFlowR/branch/main/graph/badge.svg)](https://app.codecov.io/gh/birdflow-science/BirdFlowR?branch=main)
<!-- badges: end -->

An R package to forecast changes in 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:
```{r}
devtools::install_github("birdflow-science/BirdFlowR")
```
Or to install with example data and vignette:

```{r}
install.packages("remotes")
install.packages("rnaturalearthdata") # required for vignette
remotes::install_github("birdflow-science/BirdFlowModels") # data package
remotes::install_github("birdflow-science/BirdFlowR", build_vignettes = TRUE)
```

## Usage

The two primary functions are `forecast()` 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.
```{r}
library(BirdFlowR)
library(BirdFlowModels)
library(terra)
bf <- amewoo
species(bf)
# start migration at end of the nonbreeding season
start <- species_info(bf, "nonbreeding_end")
# Retreive starting distribution as a SpatRaster and plot
r <- rast(bf, start)
plot(r)
# Generate migration routes
rts <- route_migration(bf, 10, "prebreeding")
# Add lines to plot
plot(rts$lines, add = TRUE, col = rgb(0, 0, 0, .25))
```

## Learn more

Read `vignette("BirdFlowR")` for a longer introduction to the package.


0 comments on commit 964a62f

Please sign in to comment.