Food Web Construction for Paleo Communities

R tools for reconstructing paleo food webs from species traits and size rules.


PFWIM: Paleo Food Web Inference Model

PFWIM is an R package for inferring predator–prey interactions using trait-based rules and generating hypothetical realised food webs. It implements the Paleo Food-web Inference Model (Shaw 2024) and includes tools for categorical trait matching, numerical predator–prey size rules, and power-law downsampling of realised webs.

Installation

# Install from CRAN (when available)
install.packages("pfwim")

# Or install development version from GitHub
# install.packages("devtools")
devtools::install_github("BecksLab/pfwim")

Load Example Data

library(pfwim)

# Trait data
data("traits", package = "pfwim")

# Trait combination rules
data("feeding_rules", package = "pfwim")

head(traits)
head(feeding_rules)

Inferring a consumer–resource edgelist

Use infer_edgelist() to infer feasible interactions:

edgelist <- infer_edgelist(
  data = traits,
  cat_combo_list = feeding_rules,
  col_taxon = "species",
  certainty_req = "all",
)

# Show first few interactions
head(edgelist)

Generate hypothetical realised webs

Create a series of hypothetical webs using powerlaw_prey()

webs <- powerlaw_prey(
  el = edgelist,
  n_samp = 5,
  y = 2.5
)

# Inspect first web
webs[[1]]

Each element of webs is a matrix representing a realised food web generated from the inferred interactions

Reference manual

It appears you don't have a PDF plugin for this browser. You can click here to download the reference manual.

install.packages("pfwim")

1.0.2 by Tanya Strydom, 6 months ago


https://beckslab.github.io/pfwim/, https://github.com/BecksLab/pfwim


Browse source code at https://github.com/cran/pfwim


Authors: Tanya Strydom [aut, cre] (ORCID: , Jack O. Shaw [ctb] , Alexander M. Dunhill [ctb] (ORCID: , Andrew Beckerman [ctb] , Baran Karapunar [ctb] , Jennifer A. Dunne [ctb] (ORCID: , Pincelli M. Hull [ctb]


Documentation:   PDF Manual  


MIT + file LICENSE license


Imports dplyr, stats, tibble, tidyr, tidyselect

Suggests igraph, knitr, rmarkdown, testthat


See at CRAN