generateTPData: A function to generate random stable isotope data for trophic...

generateTPDataR Documentation

A function to generate random stable isotope data for trophic position calculation

Description

This function generates random stable isotope (d13C and d15N) data to use basic functions and calculations coded within the package.

Usage

generateTPData(
  n.baselines = 2,
  n.obsB = 25,
  dNb1 = NULL,
  sd.dNb1 = 1,
  dCb1 = NULL,
  sd.dCb1 = 1,
  dNb2 = NULL,
  sd.dNb2 = 1,
  dCb2 = NULL,
  sd.dCb2 = 1,
  n.obsC = 25,
  consumer = NULL,
  dNc = NULL,
  sd.dNc = 1,
  dCc = NULL,
  sd.dCc = 1,
  DeltaN = 3.4,
  sd.DeltaN = 0.98,
  n.obsDeltaN = 56,
  DeltaC = 0.39,
  sd.DeltaC = 1.3,
  n.obsDeltaC = 107,
  seed = 3
)

Arguments

n.baselines

number of baselines (could be 1 or 2), default is 2.

n.obsB

number of observations for baselines. Default is 25.

dNb1

mean value for d15N of baseline 1. Default is a random number between -5 and 5.

sd.dNb1

standard deviation for d15N of baseline 1.

dCb1

mean value for d13C of baseline 1.

sd.dCb1

standard deviation for d13C of baseline 1.

dNb2

mean value for d15N of baseline 2.

sd.dNb2

standard deviation for d15N of baseline 2.

dCb2

mean value for d13C of baseline 2.

sd.dCb2

standard deviation for d13C of baseline 2.

n.obsC

number of observations for consumer. Default is 25.

consumer

string for consumer.

dNc

mean value for d15N of consumer. Default value is dNb1 multiplied 2 times the trophic discrimination factor.

sd.dNc

standard deviation for d15N of consumer.

dCc

mean value for d13C of consumer.

sd.dCc

standard deviation for d13C of consumer.

DeltaN

mean value for trophic discrimination factor of nitrogen. Default value is 3.4.

sd.DeltaN

standard deviation for trophic discrimination factor of nitrogen. Default value is 0.98.

n.obsDeltaN

number of observations of deltaN (trophic discrimination factor). Default value is 56.

DeltaC

mean value for trophic discrimination factor of carbon. Default value is 0.39.

sd.DeltaC

standard deviation for trophic discrimination factor for carbon. Default value is 1.3.

n.obsDeltaC

number of observations of DeltaC (trophic discrimination factor). Default is 107.

seed

numerical value to get reproducible results.

Value

An isotopeData class object (named list) with dNb1, dNc and deltaN randomly generated observations. If n.baselines = 2, then dCb1, dNb2, dCb2, dCc and deltaC are also returned.

Examples

## Good data
a <-generateTPData(dCb1 = -10, dNb1 = -10,
dCc = -4, dNc = 4,
dCb2 = 2, dNb2 = 0)
plot(a)

## Consumer more enriched in carbon
b <-generateTPData(dCb1 = -10, dCc = 0, dCb2 = -2)
plot(b)

## Consumer much more enriched
c <-generateTPData(dCb1 = -10, dCc = 3, dCb2 = -2)
plot(c)

tRophicPosition documentation built on Dec. 28, 2022, 2:27 a.m.