knitr::opts_chunk$set( collapse = TRUE, comment = "#>", fig.path = "man/img/", eval=TRUE, dpi = 150, fig.width = 4.5, fig.height = 3 ) library(ggplot2) tt <- theme_get() + theme(legend.position = c(0.98, 0.97), legend.justification = c(1, 1), text = element_text(size = 9), axis.title = element_text(size = 9.5)) theme_set(tt)
Easy numerical analysis of continuous-time population models in ecology.
Models currently supported:
Install the development version from GitHub with:
devtools::install_github("patrickbarks/popmods") # # or # install.packages("remotes") # smaller and quicker to install than devtools remotes::install_github("patrickbarks/popmods")
library(popmods) library(ggplot2) # vector of time points at which to evaluate models t <- seq(0, 50, 0.01)
df_dl <- logistic_delay(time = t, init_n = 10, r = 1.1, k = 500, tau = 1.12) ggplot(df_dl, aes(time, abundance)) + geom_line(lwd = 1.2)
df_lvpp <- lotka_volterra(time = t, init_n = 50, init_p = 30, r = 0.8, c = 0.04, a = 0.2, m = 0.3) ggplot(df_lvpp, aes(time, abundance, color = population)) + geom_line(lwd = 1.2) + scale_color_brewer(type = 'qual', palette = 6)
df_rpslk <- rpslk(time = t, init_r = 0.02, init_p = 0.02, init_s = 0.03, init_l = 0.9, init_k = 0.03, b = 0.7) ggplot(df_rpslk, aes(time, proportion, color = strategy)) + geom_line(lwd = 1.2) + scale_color_brewer(type = 'qual', palette = 6)
df_sir <- sir(time = t, init_s = 0.9999, init_i = 0.0001, init_r = 0, gamma = 0.6, beta = 0.08) ggplot(df_sir, aes(time, proportion, color = status)) + geom_line(lwd = 1.2) + scale_color_brewer(type = 'qual', palette = 6)
All contributions are welcome. Please note that this project is released with a Contributor Code of Conduct. By participating in this project you agree to abide by its terms.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.