HostSwitch: An R Package to Simulate the Extent of Host-Switching by a Consumer

In biology a general definition for host switch is when an organism (consumer) uses a new host (which represents a resource). The host switch process by a consumer may happen through its pre-existing capability to use a sub-optimal resource. The HostSwitch R package provides functions to simulate the dynamics of host switching (extent and frequency) in the population of a consumer that interacts with current and potential hosts over the generations. The HostSwitch package is based on a Individual-Based mock-up model published in FORTRAN by Araujo et al. (2015). The package largely improve the previous mock-up model, by implementing numerous new functionalities such as comparison and evaluation of simulations with several customizable parameters to accommodate several types of biological consumer-host associations, an interactive visualization of the model, an in-depth description of the parameters in a biological context. Finally, we provided three real world scenarios taken from the literature selected from ecology, agriculture and parasitology. This package is intended to reach researchers in the broad field of biology interested in simulating the process of host switch of different types of symbiotic biological associations.

Valeria Trivellone (University of Illinois at Urbana-Champaign) , Sabrina B. L. Araujo (Universidade Federal do Paraná) , Bernd Panassiti (Independent researcher)

Supplementary materials

Supplementary materials are available in addition to this article. It can be downloaded at

S. B. L. Araujo, M. P. Braga, D. R. Brooks, S. J. Agosta, E. P. Hoberg, F. W. von Hartenthal and W. A. Boeger. Understanding host-switching by ecological fitting. PLOS ONE, 10(10): e0139225, 2015. URL [online; last accessed August 30, 2019].



Text and figures are licensed under Creative Commons Attribution CC BY 4.0. The figures that have been reused from other sources don't fall under this license and can be recognized by a note in their caption: "Figure from ...".


For attribution, please cite this work as

Trivellone, et al., "The R Journal: HostSwitch: An R Package to Simulate the Extent of Host-Switching by a Consumer", The R Journal, 2023

BibTeX citation

  author = {Trivellone, Valeria and Araujo, Sabrina B. L. and Panassiti, Bernd},
  title = {The R Journal: HostSwitch: An R Package to Simulate the Extent of Host-Switching by a Consumer},
  journal = {The R Journal},
  year = {2023},
  note = {},
  doi = {10.32614/RJ-2023-005},
  volume = {14},
  issue = {4},
  issn = {2073-4859},
  pages = {179-194}