prep_fa: Prepare fatty acid information analysis

Description Usage Arguments Value Details References Examples

View source: R/prep_fa.R

Description

The function prep_fa processes the information in a fatty acid suites data frame and prepares that information for application to fatty acid signatures.

Usage

1
prep_fa(df_fa)

Arguments

df_fa

A data frame containing fatty acid names, calibration coefficients, and 0/1 definitions of fatty acid suites. qfasar has strict formatting requirements for df_fa; please see Details and/or the vignette.

Value

A list containing the following elements:

cc

A numeric vector of calibration coefficients.

use

A logical vector defining a fatty acid suite.

fa_names

A character vector of fatty acid names.

err_code

An integer error code (0 if no error is detected).

err_message

A string contains a brief summary of the execution.

Details

This function is designed to be called by the user after the fatty acid data frame has been read. The data frame should contain a complete list of all fatty acids in the prey and predator signature data, one or more sets of calibration coefficients with an indicator of which set to use, one or more fatty acid suite definitions with an indicator of which suite to use, and optional comments. Please refer to the vignette for additional information.

The fatty acid data frame must strictly meet the following formatting requirements.

References

Iverson, S.J., C. Field, W.D. Bowen, and W. Blanchard. 2004. Quantitative fatty acid signature analysis: A new method of estimating predator diets. Ecological Monographs 74:211-235.

Examples

1
2
3
4
5
6
7
8
9
prep_fa(data.frame(fa = c("use_me", "fa_1", "fa_2", "fa_3"),
                   cc = c(1, 0.75, 1.25, 1.0),
                   use = c(1, 1, 1, 1)))

prep_fa(data.frame(fa = c("use_me", "fa_1", "fa_2", "fa_3"),
                   cc1 = c(0, 0.75, 1.25, 1.00),
                   cc2 = c(1, 1.2, 0.8, 0.9),
                   use_1 = c(0, 1, 1, 0),
                   use_2 = c(1, 1, 1, 0)))

qfasar documentation built on March 20, 2020, 1:10 a.m.