-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathREADME.Rmd
127 lines (93 loc) · 4.89 KB
/
README.Rmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
---
output: github_document
---
<!-- README.md is generated from README.Rmd. Please edit that file -->
```{r, include = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>",
fig.path = "man/figures/README-",
out.width = "100%"
)
```
# Tools for modeling bumblebee colony growth
<!-- badges: start -->
[](https://github.com/Aariq/bumbl/actions) [](https://app.codecov.io/gh/Aariq/bumbl) [](https://www.repostatus.org/#inactive)
[](https://CRAN.R-project.org/package=bumbl)
[](https://cran.r-project.org/package=bumbl)
[](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*.
It returns the optimal switchpoint, growth, and decline rates for each colony.
Because the current version of `bumbl()` works by fitting a separate GLM to each colony, if covariates are included, their estimates could vary significantly among colonies.
Stay tuned for future developments that may allow estimating a single value of a covariate but different values of growth and decline 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.
I also welcome contributions including bug-fixes, improvement of documentation, additional features, or new functions relating to bumblebee ecology and demography from anyone!
### Roadmap
- [x] Write `bumbl()` function to model colony growth with switchpoint
- [x] Finish documentation and vignette(s)
- [x] [rOpenSci review](<https://github.com/ropenscilabs/statistical-software-review/issues/2>)
- [x] Regroup with Elizabeth Crone to discuss current behavior of `bumbl()`
- [x] Release v0.1.0 and archive on Zenodo
- [x] Bug fixes
- [x] Submit v1.0.0 of package to CRAN
- [x] Write a manuscript for JOSS ([desk-reject](https://github.com/openjournals/joss-reviews/issues/3532), out of scope)
- [x] Release minor version to CRAN to update citation
- [ ] Possibly re-work internals of `bumbl()`? (see [\#58](https://github.com/Aariq/bumbl/issues/58) and [notes](https://github.com/Aariq/bumbl/blob/master/notes/single-model-rework-notes.Rmd))
- [ ] Submit v2.0.0 of package to CRAN
Other possible areas of improvement:
- Extend `bumbl()` to work with GLMMs
- Test significance of switchpoint (see [\#62](https://github.com/Aariq/bumbl/issues/62))
- Extend `bumbl()` to work with dates, datetimes, or other timeseries classes (see [\#46](https://github.com/Aariq/bumbl/issues/46))
## Installation
You can install `bumbl` with:
``` r
install.packages("bumbl")
```
Or install the development version with:
``` r
devtools::install_github("Aariq/bumbl", build_vignettes = TRUE)
```
## Getting started
View the package vignette with:
``` r
library(bumbl)
vignette("bumbl")
```
```{r include=FALSE}
# library(bumbl)
devtools::load_all()
```
View the `bomubs` dataset
```{r}
head(bombus)
```
### Example use
Using a subset of the `bombus` dataframe to estimate the week (tau) that colonies switch to reproduction
```{r}
bombus2 <- bombus[bombus$colony %in% c(9, 82, 98, 35), ]
results <- bumbl(bombus2, colonyID = colony, t = week, formula = d.mass ~ week)
results
```
Plot the results
```{r}
par(mfrow = c(2, 2))
plot(results)
par(mfrow = c(1, 1))
```
# References
^1^Crone, E.
E., and Williams, N. M.
(2016).
Bumble bee colony dynamics: quantifying the importance of land use and floral resources for colony growth and queen production.
Ecol.
Lett.
19, 460–468.
<https://doi.org/10.1111/ele.12581>
------------------------------------------------------------------------
Please note that the `bumbl` project is released with a [Contributor Code of Conduct](https://github.com/Aariq/bumbl/blob/master/CODE_OF_CONDUCT.md).
By contributing to this project you agree to abide by its terms.