GithubHelp home page GithubHelp logo

frbcesab / popbayes Goto Github PK

View Code? Open in Web Editor NEW
1.0 3.0 0.0 139.99 MB

:package: Bayesian Model to Estimate Animal Population Trends from Counts Series

Home Page: https://frbcesab.github.io/popbayes/

License: GNU General Public License v2.0

R 100.00%
r population bayesian temporal-trend animal precision counts

popbayes's Introduction

popbayes

CRAN status R CMD Check Website deployment License: GPL (>= 2)

The goal of the R package popbayes is to infer trends of one or several populations over time from series of counts. It does so by accounting for count precision (provided or inferred based on expert knowledge, e.g. guesstimates), smoothing the population rate of increase over time, and accounting for the maximum demographic potential of species. Inference is carried out in a Bayesian framework. This work is part of the FRB-CESAB working group AfroBioDrivers.

Installation

Before using this package, users need to install the freeware JAGS.

You can install the stable version of the package from the CRAN with:

install.packages("popbayes")

Alternatively you can install the development version from GitHub with:

# install.packages("remotes")

remotes::install_github("frbcesab/popbayes", build_vignettes = TRUE)

Overview

Get started

Please read the Get started vignette.

Citation

Please cite this package as:

Casajus N. & Pradel R. (2023) popbayes: Bayesian model to estimate population trends from counts series. R package version 1.2.0. URL: https://frbcesab.github.io/popbayes/.

You can also run:

citation("popbayes")

## A BibTeX entry for LaTeX users is:
## 
## @Manual{,
##   title  = {{popbayes}: {B}ayesian model to estimate population trends from counts series,
##   author = {{Casajus N.}, and {Pradel R.}},
##   year   = {2023},
##   note   = {R package version 1.2.0},
##   url    = {https://frbcesab.github.io/popbayes/},
## }

popbayes's People

Contributors

ahasverus avatar olivroy avatar parguel avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar

popbayes's Issues

Release popbayes 1.1

First release:

Prepare for release:

  • devtools::build_readme()
  • urlchecker::url_check()
  • devtools::check(remote = TRUE, manual = TRUE)
  • devtools::check_win_devel()
  • rhub::check_for_cran()
  • Review pkgdown reference index for, e.g., missing topics

Submit to CRAN:

  • usethis::use_version('major')
  • devtools::submit_cran()
  • Approve email

Wait for CRAN...

  • Accepted 🎉
  • usethis::use_github_release()
  • usethis::use_dev_version()
  • usethis::use_news_md()
  • Add CRAN badge in README
  • Add installation instructions in README
  • Tweet

years order?

It should be checked if years must be sorted or not.
First year receives a specific treatment in model.

problems with Tibbles

in format_data, if argument data is a tibble, it will pass the test "data must be a data.frame", but will fail the test
"The column date must be numeric" (subsetting rules are different and yield a tibble instead of a vector.

Suggested solution: after the initial test "data must be a data.frame", add the line
data <- as.data.frame(data)

priority of information for field method, preferred field method, conversion_A2G, and rmax

currently, info has precedence; followed by the imported data, and eventually the internal package information. As flexibility is desirable at the series level (the same species in different environmental may be applied different values for these fields), precedence should be given to the imported data as this is the only level where such distinction is possible.
This also means changing format_data() to check consistency at the series level rather than the species level

Release popbayes 1.0

First release:

Prepare for release:

  • devtools::build_readme()
  • urlchecker::url_check()
  • devtools::check(remote = TRUE, manual = TRUE)
  • devtools::check_win_devel()
  • rhub::check_for_cran()
  • Review pkgdown reference index for, e.g., missing topics

Submit to CRAN:

  • usethis::use_version('major')
  • devtools::submit_cran()
  • Approve email

Wait for CRAN...

  • Accepted 🎉
  • usethis::use_github_release()
  • usethis::use_dev_version()
  • usethis::use_news_md()
  • Add CRAN badge in README
  • Add installation instructions in README
  • Tweet

role of info and category to clarify

Is info used to carry the info about some species provided with the package?
If so, may it be modified by the user?
If not, info is provided by the user and should take precedence on info in the package itself.
info is just a more convenient way to bring information that is situated at the species level and would otherwise appear on several rows in a count series?

In case the user can provide only some info on some species, this should be possible.

A column "category" should be allowed for a new species for which there is no more detailed info.

X rather than G for Guesstimate

'G' is used as the code for guesstimates in stat_method. But 'G' is also used as the code for 'ground' among the field methods. This leads to confusions. Replace 'G' by 'X' as a reminder for 'eXpert knowledge' in the stat methods.

problems with Tibbles

in format_data, if argument data is a tibble, it will pass the test "data must be a data.frame", but will fail the test
"The column date must be numeric" (subsetting rules are different and yield a tibble instead of a vector).

Suggested solution: after the initial test "data must be a data.frame", add the line
data <- as.data.frame(data)

saving several models for the same data set

Currently only the last model for a given data set is kept. Sometimes, one may want to try different options. these may be different degrees of smoothing, the use or not of rmax. Playing with rmax values. Playing with the conversion factor... Results are saved in a subdirectory built from the species and area names, meaning that the last model fitted overwrite the previous one. An enhancement would be to allow saving all models. This can already be done in R by saving the outputs from fit_trend in different objects but these objects cannot be manipulated easily.

A first improvement would be to allow output of fit_trend as input for plot_trend.

Release popbayes 1.2.0

Prepare for release:

  • git pull
  • Check current CRAN check results
  • Polish NEWS
  • usethis::use_github_links()
  • urlchecker::url_check()
  • devtools::build_readme()
  • devtools::check(remote = TRUE, manual = TRUE)
  • devtools::check_win_devel()
  • revdepcheck::revdep_check(num_workers = 4)
  • Update cran-comments.md
  • git push
  • Draft blog post

Submit to CRAN:

  • usethis::use_version('minor')
  • devtools::submit_cran()
  • Approve email

Wait for CRAN...

  • Accepted 🎉
  • Add preemptive link to blog post in pkgdown news menu
  • usethis::use_github_release()
  • usethis::use_dev_version(push = TRUE)
  • Finish blog post
  • Tweet

not unique years

These can be fractional (e.g. 2001.66) and duplicated (2 counts in the same year is allowed). Yet, the output of format_data mentions "The number of unique years".
Need to check that there is no problem with this.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.