prepare_data: preparation of the data

Description Usage Arguments Value Examples

View source: R/prepare_data.R

Description

prepares the data so that they can be used by jags to fit the model

Usage

1
2

Arguments

prior_diet_matrix

a square matrix with similar species as colnames and rownames. Species should be consistent with Species in signature_data and prior_signature_data

signature_data

a data frame. First column should be names species and followning columns should correspond to tracers. Data should be transformed first if required. Left censored data and missing data should be denoted NA

LOQ

a data frame with the same number of rows as signature_data and one column per tracer. Gives the limit of detection of limit of quantification of the corresponding measure

prior_signature_data

a data frame that contains data that can be used to build a prior signature for source species. First column should be names Species and second one tracer. Species and tracers should be consistent with signature_data. Then, the three following columns correpond to the mean signature, the standard deviation and the number of samples.

prior_delta

a table that contains prior on magnification/enrichment of tracers per trophic level. First column contains the name of the tracer, second column contains the mean value and third column the standard deviation

Value

a named list that contains formatted object that will be used by jags to fit the model

Examples

1
2
3
4
5
6
7
8
9
#importing data
data(prior_diet_matrix)
data(LOQ)
data(prior_signature_data)
prior_delta <- data.frame(tracer=c("X15N","X13C"),mean=c(3,0),sd=c(1,1))

#check that everything is ok
mydata <- prepare_data(prior_diet_matrix,signature_data,
LOQ,prior_signature_data,prior_delta)

Irstea/escroc documentation built on Dec. 9, 2018, 12:29 a.m.