calc_area()
calculates the normalized surface area of the SOURCE + TDF
convex hull, only if there are exactly 2 biotracers.
calc_area(source, mix, discr)
source | output from |
---|---|
mix | output from |
discr | output from |
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.)
Important detail is that, unlike in Brett (2014), calc_area
uses the
combined SOURCE + TDF variance to normalize the surface area:
$$\sqrt{\sigma^2_source + \sigma^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.