Learn R Programming

soilfoodwebs

The purpose of the soilfoodwebs package is to help analyze and simulate soil food webs. The following five functions are the core of the package:

  1. Calculate the fluxes through a food web given biomass, parameters, and food web structure.
  2. Calculate the direct and indirect contribution of each trophic species (i.e., node) to carbon and nitrogen mineralization.
  3. Calculate food web stability and smin.
  4. Simulate the food web away from equilibrium.
  5. Conduct a detritus decomposition simulation and calculate the decomposition constant.

The package also can complete the following tasks using functions built to work with the communities that are input:

  1. Modify the fluxes to balance carbon and nitrogen demands.
  2. Modify the structure of the food web.

Installation

You can install the released version of soilfoodwebs from GitHub with:

# Install devtools if not available:
if (!require("devtools")) install.packages("devtools")

# Install soilfoodwebs
devtools::install_github("robertwbuchkowski/soilfoodwebs")

# Install soilfoodwebs with the vignette
devtools::install_github("robertwbuchkowski/soilfoodwebs", build_vignettes = T, build_opts = c("--no-resave-data", "--no-manual"))

Example

The core of the soilfoodwebs package allows you to calculate the fluxes of carbon and nitrogen through a food web at equilibrium using basic properties about each trophic species or node.

For example, here is a plot of the carbon flow through the introductory community after corrections are made to balance nitrogen demand.

library(soilfoodwebs)
intro_comm_temp = corrstoich(intro_comm)
ana1 <- comana(intro_comm_temp, mkplot = T, whattoplot = "web")

Here are the rates of carbon and nitrogen mineralization predicted for each species.

# Carbon mineralization:
ana1$Cmin
#>   Predator      Orib2      Orib1     Fungi1     Fungi2  Detritus1  Detritus2 
#>     2.8704     9.5250    40.5350 20081.9528 19970.4067     0.0000     0.0000
# Nitrogen mineralization:
ana1$Nmin
#>      Predator         Orib2         Orib1        Fungi1        Fungi2 
#>  5.510821e-01  5.941428e-17 -3.174544e-16  1.195354e+02  4.754859e+02 
#>     Detritus1     Detritus2 
#>  0.000000e+00  0.000000e+00

Copy Link

Version

Install

install.packages('soilfoodwebs')

Monthly Downloads

245

Version

1.0.2

License

GPL-3

Maintainer

Robert Buchkowski

Last Published

May 9th, 2023

Functions in soilfoodwebs (1.0.2)

corrstoich

Correct stoichiometry
build_foodweb

A function to compile the food web from simple data inputs
stability2

A function to run the stability analysis using the numerical simulation of the Jacobain matrix.
whomineralizes

Direct and indirect contributions to mineralizations
intro_comm

A baseline community for examples
getPARAMS

A function to get the parameters for a food web model.
decompexpt

Decomposition rates and effect of individual organisms
checkeqm

Check the carbon flux equilibrium output by comana.
foodwebode

A function to simulation the food webs away from equilibrium.
removenodes

Remove nodes from community.
productionadj

A function to fix production efficiency.
deRuiter1994

The soil food webs published for conventional (CON) and integrated (INT) management at Lovinkhoeve experimental farm.
parameter_uncertainty

Parameter uncertainty returns community with new parameters drawn from a distribution of choice
newnode

Add node to the community
calculate_inputs

A function to calculate the inputs and outputs at equilibrium and print them for the user.
calc_smin

Calculate the strength of stability as smin.
correct_diet

A function to correct the diet of trophic species.
renamenode

Rename a node in a community.
stability

Calculates the stability of the food web
correction_function

A function to correct stoichiometry dynamically
Aijfcn

A function to calculate the nitrogen surplus or deficit each species gets from consuming another species
RESCALE

A function to rescale a vector.
Jacobsindex

Calculate Jacob's index.
Cijfcn

A utility function to calculate the consumption rate of each species on all prey assuming a type I functional response.
Holtkamp2011

The soil food webs published along a chronosequence in the Netherlands.
TLcheddar

Calculates the trophic level for each tropospecies
CNsim

A function to simulate the dynamics over time wrapping getPARAMS and foodwebode
checkcomm

A function check the community for errors before it is used in calculations.
comana

A function to calculate carbon and nitrogen fluxes in the food web.
can_mutfeed

A function that identifies cannibalism and mutual feeding
calculate_smin

Function used inside the calc_smin function
TLsort

Sorts the trophic levels from lowest to highest
Hunt1987

The soil food web published for CPER
Andres2016

The soil food webs published for grazed and ungrazed plots in the Shortgrass Steppe long-term research station.
Koltz2018

The soil food web published for an Arctic Tundra site
comtrosp

A function to combine trophic species.