loadIsotopeData: Extract and load stable isotope data for selected consumers...

View source: R/loadIsotopeData.R

loadIsotopeDataR Documentation

Extract and load stable isotope data for selected consumers from a data frame

Description

This function extracts only selected consumers/species with their respective baseline(s) and returns an isotopeData class object (or list). It is useful when there are a lot of information in a data frame and you want to calculate trophic position only for selected consumers in one or more communities.

Usage

loadIsotopeData(
  df = NULL,
  consumer = NULL,
  group = NULL,
  b1 = "Baseline 1",
  b2 = NULL,
  baselineColumn = "FG",
  consumersColumn = "FG",
  groupsColumn = NULL,
  d13C = "d13C",
  d15N = "d15N",
  deltaC = NULL,
  deltaN = NULL,
  seed = 666,
  ...
)

Arguments

df

data frame containing raw isotope data with at least one grouping column.

consumer

string or character vector indicating which consumer/species will be extracted.

group

string or character vector indicating which group(s) will be extracted.

b1

string or character vector indicating which baseline(s) will be extracted as baseline 1.

b2

string or character vector indicating which baseline(s) will be extracted as baseline 2.

baselineColumn

string of the column where baselines are grouped.

consumersColumn

string of the column where species/consumer(s) are grouped.

groupsColumn

string of the column where groups/communities are grouped.

d13C

string indicating from which column extract d13C isotope values.

d15N

string indicating from which column extract d15N isotope values.

deltaC

vector of values with trophic discrimination factor for carbon. If NULL it will use Post's assumptions (56 values with 3.4 mean +- 0.98 sd).

deltaN

vector of values with trophic discrimination factor for nitrogen. If NULL it will use Post's assumptions (107 values with 0.39 mean +- 1.3 sd).

seed

numerical value to get reproducible results with trophic discrimination factors (because they are simulated each time this function is called). By default, is 3.

...

Additional arguments passed to this function.

Value

an isotopeData class object if one consumer and one group are selected. A list of isotopeData class objects if more than one consumer or more than one group are selected.

Examples

data("Bilagay")
head(Bilagay)
loadIsotopeData(df = Bilagay, consumer = "Bilagay", consumersColumn = "FG",
group = c("CHI", "COL"), groupsColumn = "Location",
b1 = "Benthic_BL", b2 = "Pelagic_BL", baselineColumn = "FG")

AndrewLJackson/tRophicPosition documentation built on Jan. 2, 2023, 12:14 p.m.