calc_area: Calculate the normalized surface area of the source convex...

Description Usage Arguments Details Value See Also

View source: R/calc_area.R

Description

calc_area() calculates the normalized surface area of the SOURCE + TDF convex hull, only if there are exactly 2 biotracers.

Usage

1
calc_area(source, mix, discr)

Arguments

source

output from load_source_data

mix

output from load_mix_data

discr

output from load_discr_data

Details

Important detail is that, unlike in Brett (2014), calc_area uses the combined SOURCE + TDF variance to normalize the surface area:

√{σ^2_source + σ^2_discr}

This is the variance used in fitting the mixing model.

calc_area() relies on the splancs::areapl() function from the splancs package. If splancs is not installed, a WARNING message will appear.

Value

If source$by_factor = FALSE, calc_area returns a scalar, the normalized surface area of the SOURCE + TDF convex hull

If source$by_factor = TRUE, calc_area returns a vector, where the entries are the normalized surface areas of the convex hull of each source factor level (e.g. source data by 3 Regions, returns a 3-vector of the areas of the Region 1 convex hull, Region 2 convex hull, etc.)

See Also

Brett (2014): https://www.researchgate.net/profile/Michael_Brett/publication/269873625_Resource_polygon_geometry_predicts_Bayesian_stable_isotope_mixing_model_bias/links/549884090cf2519f5a1de635.pdf


MixSIAR documentation built on Oct. 23, 2020, 6:45 p.m.