Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .Rbuildignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
^notes$

^codecov\.yml$
^LICENSE$
^LICENSE\.md$
^\.Rhistory$
.github
Expand Down
77 changes: 23 additions & 54 deletions .github/workflows/R-CMD-check.yaml
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
# For help debugging build failures open an issue on the RStudio community with the 'github-actions' tag.
# https://community.rstudio.com/new-topic?category=Package%20development&tags=github-actions
# Workflow derived from https://github.com/r-lib/actions/tree/v2/examples
# Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help
on:
push:
branches:
- master
branches: [main, master]
pull_request:
branches:
- master

name: R-CMD-check
name: R-CMD-check.yaml

permissions: read-all

jobs:
R-CMD-check:
Expand All @@ -20,63 +19,33 @@ jobs:
fail-fast: false
matrix:
config:
- {os: macos-latest, r: 'release'}
- {os: windows-latest, r: 'release'}
- {os: windows-latest, r: 'devel'}
- {os: macOS-latest, r: 'release'}
- {os: ubuntu-20.04, r: 'release', rspm: "https://packagemanager.rstudio.com/cran/__linux__/focal/latest"}
- {os: ubuntu-20.04, r: 'devel', rspm: "https://packagemanager.rstudio.com/cran/__linux__/focal/latest"}
- {os: ubuntu-latest, r: 'devel', http-user-agent: 'release'}
- {os: ubuntu-latest, r: 'release'}
- {os: ubuntu-latest, r: 'oldrel-1'}

env:
R_REMOTES_NO_ERRORS_FROM_WARNINGS: true
RSPM: ${{ matrix.config.rspm }}
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
R_KEEP_PKG_SOURCE: yes

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- uses: r-lib/actions/setup-pandoc@v2

- uses: r-lib/actions/setup-r@v2
with:
r-version: ${{ matrix.config.r }}
http-user-agent: ${{ matrix.config.http-user-agent }}
use-public-rspm: true

- uses: r-lib/actions/setup-pandoc@v2

- name: Query dependencies
run: |
install.packages('remotes')
saveRDS(remotes::dev_package_deps(dependencies = TRUE), ".github/depends.Rds", version = 2)
writeLines(sprintf("R-%i.%i", getRversion()$major, getRversion()$minor), ".github/R-version")
shell: Rscript {0}

- name: Cache R packages
if: runner.os != 'Windows'
uses: actions/cache@v3
- uses: r-lib/actions/setup-r-dependencies@v2
with:
path: ${{ env.R_LIBS_USER }}
key: ${{ runner.os }}-${{ hashFiles('.github/R-version') }}-1-${{ hashFiles('.github/depends.Rds') }}
restore-keys: ${{ runner.os }}-${{ hashFiles('.github/R-version') }}-1-

- name: Install system dependencies
if: runner.os == 'Linux'
run: |
while read -r cmd
do
eval sudo $cmd
done < <(Rscript -e 'writeLines(remotes::system_requirements("ubuntu", "20.04"))')

- name: Install dependencies
run: |
remotes::install_deps(dependencies = TRUE)
remotes::install_cran("rcmdcheck")
shell: Rscript {0}

- name: Check
env:
_R_CHECK_CRAN_INCOMING_REMOTE_: false
run: rcmdcheck::rcmdcheck(args = c("--no-manual", "--as-cran"), error_on = "warning", check_dir = "check")
shell: Rscript {0}
extra-packages: any::rcmdcheck
needs: check

- name: Upload check results
if: failure()
uses: actions/upload-artifact@v3
- uses: r-lib/actions/check-r-package@v2
with:
name: ${{ runner.os }}-r${{ matrix.config.r }}-results
path: check
upload-snapshots: true
build_args: 'c("--no-manual","--compact-vignettes=gs+qpdf")'
63 changes: 48 additions & 15 deletions .github/workflows/test-coverage.yaml
Original file line number Diff line number Diff line change
@@ -1,29 +1,62 @@
# Workflow derived from https://github.com/r-lib/actions/tree/v2/examples
# Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help
on:
push:
branches:
- master
branches: [main, master]
pull_request:
branches:
- master

name: test-coverage
name: test-coverage.yaml

permissions: read-all

jobs:
test-coverage:
runs-on: macOS-latest
runs-on: ubuntu-latest
env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- uses: r-lib/actions/setup-r@v2
with:
r-version: 'release'
use-public-rspm: true

- name: Install dependencies
run: |
install.packages(c("remotes", "rcmdcheck"))
remotes::install_deps(dependencies = TRUE)
remotes::install_cran("covr")
shell: Rscript {0}
- uses: r-lib/actions/setup-r-dependencies@v2
with:
extra-packages: any::covr, any::xml2
needs: coverage

- name: Test coverage
run: covr::codecov()
run: |
cov <- covr::package_coverage(
quiet = FALSE,
clean = FALSE,
install_path = file.path(normalizePath(Sys.getenv("RUNNER_TEMP"), winslash = "/"), "package")
)
print(cov)
covr::to_cobertura(cov)
shell: Rscript {0}

- uses: codecov/codecov-action@v5
with:
# Fail if error if not on PR, or if on PR and token is given
fail_ci_if_error: ${{ github.event_name != 'pull_request' || secrets.CODECOV_TOKEN }}
files: ./cobertura.xml
plugins: noop
disable_search: true
token: ${{ secrets.CODECOV_TOKEN }}

- name: Show testthat output
if: always()
run: |
## --------------------------------------------------------------------
find '${{ runner.temp }}/package' -name 'testthat.Rout*' -exec cat '{}' \; || true
shell: bash

- name: Upload test results
if: failure()
uses: actions/upload-artifact@v4
with:
name: coverage-test-failures
path: ${{ runner.temp }}/package
4 changes: 2 additions & 2 deletions CITATION.cff
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ message: 'To cite package "bumbl" in publications use:'
type: software
license: CC-BY-4.0
title: 'bumbl: Tools for Modeling Bumblebee Colony Growth and Decline'
version: 1.0.3
version: 1.0.4
doi: 10.5281/zenodo.4545782
abstract: Bumblebee colonies grow during worker production, then decline after switching
to production of reproductive individuals (drones and gynes). This package provides
Expand All @@ -31,7 +31,7 @@ preferred-citation:
year: '2021'
publisher:
name: Zenodo
version: 1.0.3
version: 1.0.4
doi: 10.5281/zenodo.4545782
url: https://doi.org/10.5281/zenodo.4545782
repository: https://CRAN.R-project.org/package=bumbl
Expand Down
53 changes: 28 additions & 25 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,39 +1,42 @@
Package: bumbl
Title: Tools for Modeling Bumblebee Colony Growth and Decline
Version: 1.0.3.9000
Authors@R: c(
person(given = c("Eric", "R."),
family = "Scott",
role = c("aut", "cre"),
email = "scottericr@gmail.com",
Authors@R:
person(c("Eric", "R."), "Scott", , "scottericr@gmail.com", role = c("aut", "cre"),
comment = c(ORCID = "0000-0002-7430-7879"))
)
Description: Bumblebee colonies grow during worker production, then decline after switching to production of reproductive individuals (drones and gynes). This package provides tools for modeling and visualizing this pattern by identifying a switchpoint with a growth rate before and a decline rate after the switchpoint. The mathematical models fit by bumbl are described in Crone and Williams (2016) <doi:10.1111/ele.12581>.
Description: Bumblebee colonies grow during worker production, then
decline after switching to production of reproductive individuals
(drones and gynes). This package provides tools for modeling and
visualizing this pattern by identifying a switchpoint with a growth
rate before and a decline rate after the switchpoint. The mathematical
models fit by bumbl are described in Crone and Williams (2016)
<doi:10.1111/ele.12581>.
License: MIT + file LICENSE
Encoding: UTF-8
LazyData: true
URL: https://github.com/Aariq/bumbl
BugReports: https://github.com/Aariq/bumbl/issues
Depends:
R (>= 3.0)
Suggests:
testthat (>= 2.1.0),
knitr,
rmarkdown,
covr,
car,
rsq
Imports:
dplyr,
rlang,
tidyr (>= 1.0.0),
purrr,
broom,
dplyr,
ggplot2,
glue,
lifecycle,
MASS,
ggplot2,
lifecycle
RoxygenNote: 7.2.3
Roxygen: list(markdown = TRUE)
VignetteBuilder: knitr
purrr,
rlang,
tidyr (>= 1.0.0)
Suggests:
car,
covr,
knitr,
rmarkdown,
rsq,
testthat (>= 2.1.0)
VignetteBuilder:
knitr
Config/testthat/edition: 3
Encoding: UTF-8
LazyData: true
Roxygen: list(markdown = TRUE)
RoxygenNote: 7.3.2
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
YEAR: 2023
YEAR: 2025
COPYRIGHT HOLDER: bumbl authors
2 changes: 1 addition & 1 deletion LICENSE.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# MIT License

Copyright (c) 2023 bumbl authors
Copyright (c) 2025 bumbl authors

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
1 change: 1 addition & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# bumbl (development version)

- bumbl is now licenced under an MIT license
- fixed link in documentation for `brkpt()`

# bumbl 1.0.3

Expand Down
2 changes: 1 addition & 1 deletion R/colony-growth.R
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
#' @param tau_optim_maxit passed to `optim()` which is used to find the optimal
#' change point, tau. Mostly used for testing purposes (to force convergence
#' errors), but could be increased if optimal switchpoint doesn't converge.
#' @param ... additional arguments passed to [glm()] or [glm.nb()]
#' @param ... additional arguments passed to [glm()] or [MASS::glm.nb()]
#' @return a tibble with a column for the winning tau and a column for the
#' winning model
#' @seealso [bumbl()]
Expand Down
11 changes: 7 additions & 4 deletions README.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,16 @@ knitr::opts_chunk$set(

<!-- badges: start -->

[![R build status](https://github.com/Aariq/bumbl/workflows/R-CMD-check/badge.svg)](https://github.com/Aariq/bumbl/actions) [![codecov](https://codecov.io/gh/Aariq/bumbl/branch/master/graph/badge.svg?token=SU9rm3O2cc)](https://app.codecov.io/gh/Aariq/bumbl) [![Project Status: Inactive – The project has reached a stable, usable state but is no longer being actively developed; support/maintenance will be provided as time allows.](https://www.repostatus.org/badges/latest/inactive.svg)](https://www.repostatus.org/#inactive)
[![CRAN status](https://www.r-pkg.org/badges/version/bumbl)](https://CRAN.R-project.org/package=bumbl)
[![R-CMD-check](https://github.com/Aariq/bumbl/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/Aariq/bumbl/actions/workflows/R-CMD-check.yaml)
[![Codecov test coverage](https://codecov.io/gh/Aariq/bumbl/graph/badge.svg)](https://app.codecov.io/gh/Aariq/bumbl)
[![Project Status: Inactive – The project has reached a stable, usable state but is no longer being actively developed; support/maintenance will be provided as time allows.](https://www.repostatus.org/badges/latest/inactive.svg)](https://www.repostatus.org/#inactive)
[![CRAN status](https://www.r-pkg.org/badges/version/bumbl)](https://CRAN.R-project.org/package=bumbl)
[![metacran downloads](https://cranlogs.r-pkg.org/badges/grand-total/bumbl)](https://cran.r-project.org/package=bumbl)
[![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.4545782.svg)](https://doi.org/10.5281/zenodo.4545782)
[![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.4545782.svg)](https://doi.org/10.5281/zenodo.4545782)

<!-- badges: end -->


`bumbl` implements a model for bumblebee colony growth described in Crone and Williams 2016^1^.
It models colony growth as having a switchpoint at some time, *tau*, where the colony switches from growth and worker production to gyne production and decline.
Currently `bumbl()` works by fitting a separate switchpoint model to each colony, optimizing the switchpoint, *tau*.
Expand All @@ -33,7 +36,7 @@ Stay tuned for future developments that may allow estimating a single value of a

## Contributing

I'm looking for collaborators who know (or are willing to let me teach them) how to use git and GitHub and who have an interest in helping to develop and maintain this package long-term.
I'm looking for collaborators who know (or are willing to let me teach them) how to use git and GitHub and who have an interest in taking over as maintainer of this package.
I'm not a bumblebee biologist, so I would especially love a collaborator who works on bumblebees or other organisms with a similar growth, switch, decline lifecycle.

I also welcome contributions including bug-fixes, improvement of documentation, additional features, or new functions relating to bumblebee ecology and demography from anyone!
Expand Down
33 changes: 16 additions & 17 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@

<!-- badges: start -->

[![R build
status](https://github.com/Aariq/bumbl/workflows/R-CMD-check/badge.svg)](https://github.com/Aariq/bumbl/actions)
[![codecov](https://codecov.io/gh/Aariq/bumbl/branch/master/graph/badge.svg?token=SU9rm3O2cc)](https://app.codecov.io/gh/Aariq/bumbl)
[![R-CMD-check](https://github.com/Aariq/bumbl/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/Aariq/bumbl/actions/workflows/R-CMD-check.yaml)
[![Codecov test
coverage](https://codecov.io/gh/Aariq/bumbl/graph/badge.svg)](https://app.codecov.io/gh/Aariq/bumbl)
[![Project Status: Inactive – The project has reached a stable, usable
state but is no longer being actively developed; support/maintenance
will be provided as time
Expand Down Expand Up @@ -36,11 +36,10 @@ rates and *tau* for each colony.
## Contributing

I’m looking for collaborators who know (or are willing to let me teach
them) how to use git and GitHub and who have an interest in helping to
develop and maintain this package long-term. I’m not a bumblebee
biologist, so I would especially love a collaborator who works on
bumblebees or other organisms with a similar growth, switch, decline
lifecycle.
them) how to use git and GitHub and who have an interest in taking over
as maintainer of this package. I’m not a bumblebee biologist, so I would
especially love a collaborator who works on bumblebees or other
organisms with a similar growth, switch, decline lifecycle.

I also welcome contributions including bug-fixes, improvement of
documentation, additional features, or new functions relating to
Expand Down Expand Up @@ -102,15 +101,15 @@ View the `bomubs` dataset
``` r
head(bombus)
#> # A tibble: 6 × 10
#> site colony wild habitat date week mass d.mass floral_reso…¹ cum_f…²
#> <fct> <fct> <dbl> <fct> <date> <int> <dbl> <dbl> <dbl> <dbl>
#> 1 PUT2 9 0.98 W 2003-04-03 0 1910. 0.1 27.8 27.8
#> 2 PUT2 9 0.98 W 2003-04-09 1 1940 30.6 27.8 55.5
#> 3 PUT2 9 0.98 W 2003-04-15 2 1938 28.6 27.8 83.3
#> 4 PUT2 9 0.98 W 2003-04-22 3 1976. 67.1 27.8 111.
#> 5 PUT2 9 0.98 W 2003-05-01 4 2010. 101. 7.96 119.
#> 6 PUT2 9 0.98 W 2003-05-07 5 2143 234. 7.96 127.
#> # … with abbreviated variable names ¹​floral_resources, ²​cum_floral
#> site colony wild habitat date week mass d.mass floral_resources
#> <fct> <fct> <dbl> <fct> <date> <int> <dbl> <dbl> <dbl>
#> 1 PUT2 9 0.98 W 2003-04-03 0 1910. 0.1 27.8
#> 2 PUT2 9 0.98 W 2003-04-09 1 1940 30.6 27.8
#> 3 PUT2 9 0.98 W 2003-04-15 2 1938 28.6 27.8
#> 4 PUT2 9 0.98 W 2003-04-22 3 1976. 67.1 27.8
#> 5 PUT2 9 0.98 W 2003-05-01 4 2010. 101. 7.96
#> 6 PUT2 9 0.98 W 2003-05-07 5 2143 234. 7.96
#> # ℹ 1 more variable: cum_floral <dbl>
```

### Example use
Expand Down
Loading
Loading