Learn R Programming

fishflux: A tool to model elemental fluxes in fishes

Overview

The fishflux package provides a tool to model fluxes of C (carbon), N (nitrogen) and P (phosphorus) in fishes. It combines basic principles from elemental stoichiometry and metabolic theory. The package offers a user-friendly interface to apply the model. fishflux is ideal for fish ecologists wishing to predict ingestion, egestion and excretion to study fluxes of elements.

Main assets:

  • Provides function to model fluxes of carbon, nitrogen and phosphorus for fishes
  • Allows for the estimation of uncertainty, depending on the uncertainty of the input parameters
  • Provides some functions to help find parameters as inputs for the model
  • Provides functions to extract and illustrate results

Theoretical framework

For more information on the theoretical framework behind cnp_model_mcmc(), check out the paper.

Installing and loading fishflux

First, make sure your R version is 3.4 or higher and you have rtools installed.

CRAN

fishflux is now available on CRAN:

install.packages("fishflux")
library(fishflux)

Note that if you are using a linux operating system, you still need a c++ compiler to install the package from CRAN. If you are using Windows or Mac, you can install a pre-compiled binary version and thus don’t need a compiler.

GitHub

Please follow these steps to install the development version of the package from Github. fishflux uses Markov Chain Monte Carlo simulations provided by stan. Therefore, the first step is to install rstan. It’s important to closely follow all the steps described on the page depending on your operating system, because rstan requires a functioning C++ compiler. Furthermore, fishflux depends on the package rstantools version 2.0.0 or higher. This means that if you already have an older version of rstantools installed, you will have to reinstall it, prior to the installation of fishflux.

Once you have your c++ compiler set up correctly, you are ready to install it from GitHub.

install.packages("devtools")
devtools::install_github("nschiett/fishflux", dependencies=TRUE)
library(fishflux)

Downloaded package file

Another option is to download the source file available on github here.

install.packages(path_to_fishflux_file, repos = NULL, type = "source")
library(fishflux)

Documentation

See package vignette for an introduction and help pages. For more information on the theoretical model see here.

License

This R package is provided for use under the MIT License (MIT) by the author.

Citation

When using the bioenergetic model featured in this package, please cite:

Schiettekatte, NMD, Barneche, DR, Villéger, S, et al. Nutrient limitation, bioenergetics and stoichiometry: A new model to predict elemental fluxes mediated by fishes. Funct Ecol. 2020; 34: 1857– 1869. https://doi.org/10.1111/1365-2435.13618

Copy Link

Version

Install

install.packages('fishflux')

Monthly Downloads

25

Version

0.0.1.6

License

MIT + file LICENSE

Maintainer

Nina Schiettekatte

Last Published

May 6th, 2022

Functions in fishflux (0.0.1.6)

growth_params

A function to find growth parameters on fishbase
cnp_mcmc

cnp_mcmc
fishflux-package

The 'fishflux' package.
metabolic_parameters

Data with metabolic parameters on family level
aspect_ratio

A function to find aspect ratio
limitation

A function to evaluate element limitation of the model
find_lw

A function to find length-weight relationship parameters a and b
cnp_model_mcmc

A function to predict N and P excretion, CNP egestion, CNP ingestion rate, using MCMC and stan
extract

A function to extract specific model output parameters from result
sensitivity

A function to check the sensitivity of cnp_model predictions based on the variation of input parameters
metabolic_rate

A function to calculate metabolic rates
model_parameters

A function to find a set of parameters
name_errors

A function to find errors in fish species names
metabolism

A function to estimate f0 and alpha
param_zebsco

List of all parameters needed to run cnp_model for *Zebrasoma scopas*
plot_cnp

A function to plot results model
weight_prop

Data frame with dry weight/ wet weight proportions for multiple reef fish families.
wprop

A function to find the ratio of dry weight and wet weight of fish in local database
check_name_fishbase

Returns error if name is incorrect
trophic_level

A function to find trophic level