Learn R Programming

⚠️There's a newer version (1.1.1) of this package.Take me there.

barrks

The goal of barrks (bark beetle raster kit for seasonal development) is to calculate the phenological development of bark beetles. Rather than implementing one specific model, the package provides a collection of different models that can be chosen. Additionally, the models can be customized and combined to create an individual model. The calculations can be done spatially explicit by using raster inputs, or based on station inputs that are available as data frames. Even though most of the implemented models describe the phenology of Ips typographus, the package is not limited to particular bark beetle species. For instance, CHAPY models the phenology of Pityogenes chalcographus and the package may be extended by models for additional bark beetle species. The full documentation of barrks can be found here.

The following table lists the models that are implemented in the package.

ModelPublicationSpeciesHelp
BSOJakoby, Lischke, and Wermelinger (2019)I. typographus?model.bso.apply ?model.bso.customize
LangeLange, Økland, and Krokene (2008)I. typographus?model.lange.apply ?model.lange.customize
JönssonJönsson et al. (2011)I. typographus?model.joensson.apply ?model.joensson.customize
PHENIPSBaier, Pennerstorfer, and Schopf (2007)I. typographus?model.phenips.apply ?model.phenips.customize
PHENIPS‑Clim-I. typographus?model.phenips_clim.apply ?model.phenips_clim.customize
RITYOgris et al. (2019)I. typographus?model.rity.apply ?model.rity.customize
CHAPYOgris et al. (2020)P. chalcographus?model.chapy.apply ?model.chapy.customize

Installation

The latest released version of barrks can be installed from CRAN from within R:

install.packages('barrks')

The development version of barrks can be installed from GitHub:

devtools::install_github("jjentschke/barrks")

Basic Example

barrks comes with sample data that will be used below. The phenology is calculated with phenology() which takes all necessary inputs as arguments. Subsequently, the rasters of emerged generations by date can be retrieved with get_generations_rst(). terra::plot() can be used to visualize these rasters.


library(barrks)
library(tidyverse)
library(terra)


# calculate phenology
pheno <- phenology('phenips-clim', barrks_data())

# plot number of prevailing generations on 4 different dates
dates <- c('2015-04-15', '2015-06-15', '2015-08-15', '2015-10-15')
get_generations_rst(pheno, dates) %>% plot(mar = c(0.2, 0.1, 2, 5),
                                           axes = FALSE, box = TRUE, nr = 1,
                                           cex.main = 1.9, plg = list(cex = 1.8))

barrks makes it easy to plot the development of the individual generations. To illustrate that, a “shaded” variant of the phenology above is calculated and the development diagram for a specific cell (called “station” in barrks) is plotted for both phenology variants.


pheno_shaded <- phenology('phenips-clim', barrks_data(), exposure = 'shaded')

plot_development_diagram(list(sunny = pheno, shaded = pheno_shaded),
                         stations_create('Example', 234),
                         .lty = c(1, 2),
                         xlim = as.Date(c('2015-04-01', '2015-12-31')))

References

Baier, Peter, Josef Pennerstorfer, and Axel Schopf. 2007. “PHENIPS—A comprehensive phenology model of Ips typographus (L.)(Col., Scolytinae) as a tool for hazard rating of bark beetle infestation.” Forest Ecology and Management 249 (3): 171–86. https://doi.org/10.1016/j.foreco.2007.05.020.

Jakoby, Oliver, Heike Lischke, and Beat Wermelinger. 2019. “Climate change alters elevational phenology patterns of the European spruce bark beetle (Ips typographus).” Global Change Biology 25 (12): 4048–63. https://doi.org/10.1111/gcb.14766.

Jönsson, Anna Maria, Susanne Harding, Paal Krokene, Holger Lange, Ake Åke Lindelöw, Bjørn Økland, Hans Peter Ravn, and Leif Martin Schroeder. 2011. “Modelling the potential impact of global warming on Ips typographus voltinism and reproductive diapause.” Climatic Change 109: 695–718. https://doi.org/10.1007/s10584-011-0038-4.

Lange, Holger, Bjørn Økland, and Paal Krokene. 2008. “To Be or Twice to Be? The Life Cycle Development of the Spruce Bark Beetle Under Climate Change.” In Unifying Themes in Complex Systems: Proceedings of the Sixth International Conference on Complex Systems, 251–58. Springer. https://doi.org/10.1007/978-3-540-85081-6_32.

Ogris, Nikica, Mitja Ferlan, Tine Hauptman, Roman Pavlin, Andreja Kavčič, Maja Jurc, and Maarten De Groot. 2019. “RITY–A phenology model of Ips typographus as a tool for optimization of its monitoring.” Ecological Modelling 410: 108775. https://doi.org/10.1016/j.ecolmodel.2019.108775.

Ogris, Nikica, Mitja Ferlan, Tine Hauptman, Roman Pavlin, Andreja Kavčič, Maja Jurc, and Maarten de Groot. 2020. “Sensitivity analysis, calibration and validation of a phenology model for Pityogenes chalcographus (CHAPY).” Ecological Modelling 430: 109137. https://doi.org/10.1016/j.ecolmodel.2020.109137.

Copy Link

Version

Install

install.packages('barrks')

Monthly Downloads

204

Version

1.1.0

License

GPL (>= 3)

Issues

Pull Requests

Stars

Forks

Maintainer

Jakob Jentschke

Last Published

March 3rd, 2025

Functions in barrks (1.1.0)

analyse.phenology

Analyse a phenology
create_onset

Create phenological events (onset/diapause/mortality)
categorize_generations_rst

Make a numeric generations raster categorical
create_daylength_df

Create a data frame of day lengths
create_daylength_rst

Create day length rasters
get_input_data

Get (preprocessed) input data
model.bso.customize

Customize BSO
model.chapy.customize

Customize CHAPY
model.joensson.customize

Customize the Jönsson model
model.joensson.apply

Use the Jönnson model
model.lange.apply

Use the Lange model
model.chapy.apply

Use CHAPY
create_suntimes_df

Create a data frame of sunrises and sunsets
model.bso.apply

Use BSO
model

Get a phenology model
model_combine

Combine different (sub-)models
list_models

List all models
model.rity.customize

Customize RITY
model.rity.apply

Use RITY
model.phenips_clim.customize

Customize PHENIPS-Clim
phenology

Central function to calculate a phenology
params

Get model parameters
properties

Get phenology properties
plot_development_diagram

Plot a development diagram
model.phenips.apply

Use PHENIPS
model.lange.customize

Customize the Lange model
stations_create

Work with stations
save_phenology

Save/load a phenology
model.phenips_clim.apply

Use PHENIPS-Clim
model.phenips.customize

Customize PHENIPS
bso_get_flight_rst

Get flight of individuals (BSO only)
analyse.phenology.bso

Analyse a BSO generated phenology
barrks-package

barrks: Calculate Bark Beetle Phenology Using Different Models
bso_get_individuals_rst

Get individuals (BSO only)
barrks_data

Load sample data
bso_plot_stage_diagram

Plot a stage diagram (BSO only)
barrks_colors

Get barrks default color palettes
bso_plot_flight_diagram

Plot a flight diagram (BSO only)
barrks_labels

Get barrks default legend labels
create_suntimes_rsts

Create rasters that indicate sunrise and sunset
bso_translate_phenology

Translate BSO generated phenology
get_development_rst

Get the beetles development
get_generations_rst

Get generations
get_onset_rst

Get onset, diapause or mortality