bSims

Bird Point Count Simulator

https://github.com/psolymos/bsims

Science Score: 26.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
  • DOI references
    Found 4 DOI reference(s) in README
  • Academic publication links
  • Committers with academic emails
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (15.9%) to scientific vocabulary

Keywords

bias birds detectability shiny simulation survey-design
Last synced: 9 months ago · JSON representation

Repository

Bird Point Count Simulator

Basic Info
Statistics
  • Stars: 4
  • Watchers: 1
  • Forks: 2
  • Open Issues: 0
  • Releases: 3
Topics
bias birds detectability shiny simulation survey-design
Created about 7 years ago · Last pushed 9 months ago
Metadata Files
Readme Changelog Code of conduct

README.Rmd

---
output:
  md_document:
    variant: gfm
---

```{r, echo = FALSE}
knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>",
  fig.path = "README-"
)
set.seed(0)
```

# bSims: Bird Point Count Simulator



A highly scientific and utterly addictive bird point count simulator to test statistical assumptions and to aid survey design.

[![CRAN version](https://www.r-pkg.org/badges/version/bSims)](https://CRAN.R-project.org/package=bSims)
[![CRAN RStudio mirror downloads](https://cranlogs.r-pkg.org/badges/grand-total/bSims)](https://peter.solymos.org/bSims/)
[![check](https://github.com/psolymos/bSims/actions/workflows/check.yml/badge.svg)](https://github.com/psolymos/bSims/actions/workflows/check.yml)

> _"I've yet to see any problem, however complicated, which when you looked at it the right way didn't become still more complicated."_
> -- Poul Anderson, Call Me Joe 

> *Love the simulation we're dreaming in* - Dua Lipa, Physical

The goal of the package is to:

- test statistical assumptions,
- aid survey design,
- and have fun while doing it!

Design objectives:

- small (point count) scale implementation,
- habitat is considered homogeneous except for edge effects,
- realistic but efficient implementation of biological mechanisms and observation process,
- defaults chosen to reflect common practice and assumptions,
- extensible (PRs are welcome).

See the package in action in the [**QPAD
Book**](https://peter.solymos.org/qpad-book/).

Check out the [**QPAD workshop**](https://peter.solymos.org/qpad-workshop/).

Read/cite the paper [**Agent-based simulations improve abundance estimation**](https://rdcu.be/doDwI) (DOI 10.1007/s42977-023-00183-2).

## Install

CRAN version:

```{r eval=FALSE}
install.packages("bSims")
```

Development version:

```{r eval=FALSE}
remotes::install_github("psolymos/bSims")
```

See what is new in the [NEWS](NEWS.md) file.

## License

[GPL-2](https://www.gnu.org/licenses/old-licenses/gpl-2.0.html)

Please cite (see `citation("bSims")`) the paper:

Solymos, P. 2023. Agent-based simulations improve abundance estimation. _Biologia Futura_ 74, 377--392 [DOI 10.1007/s42977-023-00183-2](https://doi.org/10.1007/s42977-023-00183-2), [link to PDF](https://rdcu.be/doDwI).

## Contributing

Feedback and contributions are welcome:

- submit feature request or report issues [here](https://github.com/psolymos/bSims/issues),
- fork the project and submit pull request, see [CoC](CODE_OF_CONDUCT.md).

## Examples

### Command line

```{r message=FALSE,warning=FALSE}
library(bSims)

phi <- 0.5
tau <- 1:3
dur <- 10
rbr <- c(0.5, 1, 1.5, Inf)
tbr <- c(3, 5, 10)

l <- bsims_init(10, 0.5, 1)
p <- bsims_populate(l, 1)
a <- bsims_animate(p, vocal_rate=phi, duration=dur)
o <- bsims_detect(a, tau=tau)

x <- bsims_transcribe(o, tint=tbr, rint=rbr)

get_table(x)

head(get_events(a))

head(get_detections(o))
```

### Shiny apps

A few [Shiny](https://shiny.posit.co/) apps come with the package.
These can be used to interactively explore the effects of different settings.

Compare distance functions:

```{r eval=FALSE}
run_app("distfunH")
run_app("distfunHER")
```

Compare simulation settings for a single landscape:

```{r eval=FALSE}
run_app("bsimsH")
run_app("bsimsHER")
```

The [Shinylive](https://shinylive.io/r/examples/) versions of the apps can be found here:

- [`distfunH`](https://peter.solymos.org/bSims/apps/distfunH/)
- [`distfunHER`](https://peter.solymos.org/bSims/apps/distfunHER/)
- [`bsimsH`](https://peter.solymos.org/bSims/apps/bsimsH/)
- [`bsimsHER`](https://peter.solymos.org/bSims/apps/bsimsHER/)

### Replicating simulations

Interactive sessions can be used to explore different settings.
Settings can be copied from the Shiny apps and replicated using the
`bsims_all` function: 

```{r}
b <- bsims_all(extent=5, road=1, density=c(1,1,0))
b
```

The object has handy methods:

```{r eval=FALSE}
b$settings()      # retrieve settings
b$new()           # replicate once
b$replicate(10)   # replicate 10x
```

The `$replicate()` function also runs on multiple cores:

```{r}
library(parallel)
b <- bsims_all(density=0.5)
B <- 4  # number of runs
nc <- 2 # number of cores

## sequential
system.time(bb <- b$replicate(B, cl=NULL))

## parallel clusters
cl <- makeCluster(nc)
## note: loading the package is optional
system.time(clusterEvalQ(cl, library(bSims)))
system.time(bb <- b$replicate(B, cl=cl))
stopCluster(cl)

## parallel forking
if (.Platform$OS.type != "windows") {
  system.time(bb <- b$replicate(B, cl=nc))
}
```

Owner

  • Name: Peter Solymos
  • Login: psolymos
  • Kind: user
  • Location: Edmonton, Canada

Tech-bio-nerd

GitHub Events

Total
  • Issues event: 1
  • Push event: 15
  • Fork event: 3
Last Year
  • Issues event: 1
  • Push event: 15
  • Fork event: 3

Committers

Last synced: over 1 year ago

All Time
  • Total Commits: 325
  • Total Committers: 2
  • Avg Commits per committer: 162.5
  • Development Distribution Score (DDS): 0.012
Past Year
  • Commits: 17
  • Committers: 1
  • Avg Commits per committer: 17.0
  • Development Distribution Score (DDS): 0.0
Top Committers
Name Email Commits
Peter Solymos p****s@g****m 321
Peter Solymos p****s@e****m 4
Committer Domains (Top 20 + Academic)

Issues and Pull Requests

Last synced: 9 months ago

All Time
  • Total issues: 16
  • Total pull requests: 3
  • Average time to close issues: 17 days
  • Average time to close pull requests: less than a minute
  • Total issue authors: 1
  • Total pull request authors: 1
  • Average comments per issue: 1.19
  • Average comments per pull request: 0.0
  • Merged pull requests: 3
  • Bot issues: 0
  • Bot pull requests: 0
Past Year
  • Issues: 1
  • Pull requests: 0
  • Average time to close issues: about 5 hours
  • Average time to close pull requests: N/A
  • Issue authors: 1
  • Pull request authors: 0
  • Average comments per issue: 0.0
  • Average comments per pull request: 0
  • Merged pull requests: 0
  • Bot issues: 0
  • Bot pull requests: 0
Top Authors
Issue Authors
  • psolymos (16)
Pull Request Authors
  • psolymos (3)
Top Labels
Issue Labels
enhancement (5) wontfix (2)
Pull Request Labels

Packages

  • Total packages: 1
  • Total downloads:
    • cran 243 last-month
  • Total dependent packages: 0
  • Total dependent repositories: 0
  • Total versions: 4
  • Total maintainers: 1
cran.r-project.org: bSims

Agent-Based Bird Point Count Simulator

  • Versions: 4
  • Dependent Packages: 0
  • Dependent Repositories: 0
  • Downloads: 243 Last month
Rankings
Forks count: 21.9%
Stargazers count: 26.2%
Dependent packages count: 29.8%
Average: 34.5%
Dependent repos count: 35.5%
Downloads: 59.4%
Maintainers (1)
Last synced: 9 months ago

Dependencies

DESCRIPTION cran
  • MASS * depends
  • deldir >= 1.0 depends
  • intrval * depends
  • mefa4 * depends
  • parallel * imports
  • pbapply * imports
  • detect * suggests
  • knitr * suggests
  • rmarkdown * suggests
  • shiny * suggests
.github/workflows/check.yml actions
  • JamesIves/github-pages-deploy-action 4.0.0 composite
  • actions/checkout v2 composite
  • r-lib/actions/setup-r v1 composite
.github/workflows/rhub.yaml actions
  • r-hub/actions/checkout v1 composite
  • r-hub/actions/platform-info v1 composite
  • r-hub/actions/run-check v1 composite
  • r-hub/actions/setup v1 composite
  • r-hub/actions/setup-deps v1 composite
  • r-hub/actions/setup-r v1 composite