Learn R Programming

isotracer: an R package for the analysis of tracer addition experiments

Isotope tracer addition experiments are used to answer a wide variety of biological, ecological and evolutionary questions. In these experiments, a labeled element is injected into a biological system and its fate is traced throughout the system to estimate the flux of matter across compartments. Tracer additions can be used across all levels of biological organization from cells and tissues, to organisms and ecosystems. The isotracer package provides tools to analyze data from such experiments.

Getting started

The recommended way to install the package is to get the latest version from CRAN:

install.packages("isotracer")

The documentation for the latest stable version is available online. Start with the Quick Start tutorial!

If you are feeling adventurous, you might want to install the latest development version from GitLab. It might have new features that the stable version on CRAN doesn’t have yet, but it might also be less stable:

devtools::install_gitlab("matthieu-bruneaux/isotracer")

How to cite the package

Running citation("isotracer") will return two references you can use if you want to cite isotracer.

The first reference is the paper describing the original method:

  • López-Sepulcre A, Bruneaux M, Collins SM, El-Sabaawi R, Flecker AS, Thomas SA (2020). “A new method to reconstruct quantitative food webs and nutrient flows from isotope tracer addition experiments.” The American Naturalist, 195(6), 964-985. doi: 10.1086/708546 (URL: https://doi.org/10.1086/708546).

The second reference is the paper introducing isotracer itself:

  • Bruneaux M, López-Sepulcre A (2022). “isotracer: An R package for the analysis of tracer addition experiments.” Methods in Ecology and Evolution, 13(5), 1119-1134. doi: 10.1111/2041-210X.13822 (URL: https://doi.org/10.1111/2041-210X.13822).

Contact

Copy Link

Version

Install

install.packages('isotracer')

Monthly Downloads

587

Version

1.1.8

License

GPL-3

Maintainer

Mattieu Bruneaux

Last Published

March 7th, 2025

Functions in isotracer (1.1.8)

filter.ppcNetworkModel

Filter method for output of tidy_data_and_posterior_predict()
eelgrass

Eelgrass phosphate incorporation data (McRoy & Barsdate 1970)
format.prior

Pretty formatting of a prior object
dic

Calculate DIC from a model output
delta2prop

Convert delta notation to proportion of heavy isotope
filter_by_group

Filter a tibble based on the "group" column
as_tbl_graph

Generic for as_tbl_graph()
hcauchy_p

Define a half-Cauchy prior (on [0;+Inf])
filter

Filter (alias for filter function from dplyr)
exponential_p

Define an exponential prior
new_networkModel

Create an empty network model
normal_p

Define a truncated normal prior (on [0;+Inf])
pillar_shaft.prior

Function used for displaying prior object in tibbles
ggtopo.topology

Plot a topology
format.prior_tibble

Pretty formatting of a prior_tibble object
plot.ready_for_unit_plot

Plot output from split_to_unit_plot
posterior_predict.networkModelStanfit

Draw from the posterior predictive distribution of the model outcome
groups.networkModel

Get the grouping for a networkModel object
posterior_predict

Draw from the posterior predictive distribution of the model outcome
ggtopo

Plot a topology
plot.networkModel

Plot observations/trajectories/predictions from a network model
ggtopo.networkModel

Plot a network topology
isotracer-package

The 'isotracer' package
prop_family

Return the distribution family for observed proportions
c.mcmc.list

Combine mcmc.list objects
mcmc_heatmap

Draw a heatmap based on the correlations between parameters
prop2delta

Convert isotopic proportions to delta values
available_priors

List the available priors for model parameters
set_params

Set the parameters in a network model
gamma_p

Define a gamma prior
predict.networkModel

Add a column with predictions from a fit
missing_priors

Get a table with parameters which are missing priors
project

Calculate the trajectories of a network model
set_prior

Set prior(s) for a network model
as_tbl_graph.topology

Convert a network topology to a tbl_graph
priors

Return the tibble containing the priors of a networkModel
run_mcmc

Run a MCMC sampler on a network model using Stan
set_prop_family

Set the distribution family for observed proportions
select.mcmc.list

Select parameters based on their names
sample_from_prior

Sample from a prior object
ggflows

A quick-and-dirty way of visualizing relative flows in a network
obj_sum.prior

Function used for displaying prior object in tibbles
quick_sankey

Draw a Sankey plot with basic defaults
uniform_p

Define a uniform prior
type_sum.prior

Function used for displaying prior object in tibbles
sample_from

Generate samples from a network model
print.networkModel

Print method for networkModel objects
lalaja

Dataset for nitrogren fluxes in a Trinidadian mountain stream (Collins 2016)
li2017

Protein degradation in Arabidopsis plants (Li et al. 2017)
set_half_life

Set the half-life for radioactive tracers
params

Return the parameters of a network model
print.prior

Pretty printing of a prior object
set_size_family

Set the distribution family for observed sizes
sample_params

Sample parameter values from priors
set_obs

Set observations in a network model
set_init

Set initial conditions in a network model
stanfit_to_named_mcmclist

Convert a Stanfit object to a nicely named mcmc.list object
print.prior_tibble

Pretty printing of a prior_tibble object
set_topo

Set the topology in a network model.
reexports

Objects exported from other packages
[.networkModelStanfit

Subset method for networkModelStanfit objects
topo

Return the list of topologies, or a unique topology if all identical
traceplot

Plot mcmc.list objects
set_steady

Flag some network compartments as being in a steady state
size_family

Return the distribution family for observed sizes
tidy_trajectories

Build a tidy table with the trajectories for each iteration
tidy_data

Extract data from a networkModel object into a tidy tibble.
trini_mod

Network model for nitrogen fluxes in Trinidadian streams (Collins et al. 2016)
print.topology

Pretty printing of a topology object
scaled_beta_p

Define a beta prior (on [0;scale])
sankey

Draw a Sankey plot for a network and estimated flows
set_split

Flag some network compartments as being split compartments
tidy_dpp

Prepare tidy data and posterior predictions
tidy_posterior_predict

Draw from the posterior predictive distribution of the model outcome
tidy_steady_states

Build a tidy table with the calculated steady states for each iteration
tidy_mcmc

Extract a tidy output from an mcmc.list
tidy_flows

Build a tidy table with the flows for each iteration
Ops.mcmc.list

Ops generics for mcmc.list objects
add_covariates

Add fixed effects of one or several covariates to some parameters.
Math.mcmc.list

Math generics for mcmc.list objects
add_pulse_event

Register a pulse event on one of the compartment of a topology
aquarium_run

An MCMC run from a simple aquarium network model
Ops.prior

Implementation of the '==' operator for priors
as.mcmc.list.tidy_steady_states

Convert a tidy_steady_states object to an mcmc.list
Ops.topology

Ops generics for topology objects
as.mcmc.list.tidy_flows

Convert a tidy_flows object to an mcmc.list
calculate_steady_state

Calculate steady-state compartment sizes for a network
comps

Return the compartments of a network model
aquarium_mod

A simple aquarium network model, ready to run
constant_p

Define a fixed-value prior