Added basic simper() function to SECC.functions.R

SIMPER = "Similarity Percentages"
i.e. decomposition of Bray-Curtis Similarity / Distances 
     within / between a priori groups,
     for each species / variable.

There are fancier versions online, but none in an official package, nor with an algorithm that I can understand and trust.  This works, and approximates the PRIMER results.


Signed-off-by: Jonathan A. Whiteley <jonathan.whiteley@mail.mcgill.ca>
Allow SECC_aggregate to specify a different function to aggregate (default is still `mean`)
Separate script for Regional-level (Frag) ANOVAs

Aggregate data to Frag (meta-community) scale before calling this script.
- Essentially the same as standard nested ANOVA, but without the Position treatment
- written for use with Fauna data, which is aggregated differently than most other data.

Eventually, remove ALL regional analyses from basic ANOVA script (simpler).

Signed-off-by: Jonathan A. Whiteley <jonathan.whiteley@mail.mcgill.ca>
Started separate script for regional (Frag) scale analysis of fauna data

May have to change which dataset I start with (full vs. processed).
Regional (Frag) scale ANOVA: Fauna Richness (NS)

Samples sizes too small to make any meaningful conclusions, despite suggestive patterns.

Now have separate script for Regional (Frag) scale ANOVAs for anything else, however :/

Signed-off-by: Jonathan A. Whiteley <jonathan.whiteley@mail.mcgill.ca>
Model 2 regression for species correlations

There is no "explanatory variable, the plot is just to show overall positive correlations.
Legend is not being drawn correctly (bug?)

Signed-off-by: Jonathan A. Whiteley <jonathan.whiteley@mail.mcgill.ca>
PCoA; SIMPER; fixed correlation plot

Added PCoA & SIMPER analyses
- required minor fixes to `simper()` function
- There's a lot of numbers in the SIMPER output to interpret!  It is not currently exported.

Fixed and improved the correlation plot of Predators & Grazers,
including adding a model 2 regression with confidence intervals.

Signed-off-by: Jonathan A. Whiteley <jonathan.whiteley@mail.mcgill.ca>
Tweaked Univariate analyses, code cleanup

added `SECCplotDataANOVA()` function to standardize the way ANOVA plot data is generated.
Now includes back-transformation for standard transformations, so data can be plotted on original scale :D

Grazer data is now square-root transformed to preserve normality of residuals (and it keeps comparison intervals tighter).

Signed-off-by: Jonathan A. Whiteley <jonathan.whiteley@mail.mcgill.ca>
Fauna code clean-up and preparation for spatial analyses
ANOSIM reboot

Revamped ANOSIM steps to assemble results into a single table
Can also handle multiple distance metrics / transformations

Signed-off-by: Jonathan A. Whiteley <jonathan.whiteley@mail.mcgill.ca>
Exploring different transformations & distance measures.

Also export ANOSIM results as LaTeX table :)

Signed-off-by: Jonathan A. Whiteley <jonathan.whiteley@mail.mcgill.ca>
Fauna: Distance fixes and graphics touch-ups

Turns out semi-transparency is not supported in eps graphics.
But it is in pdf graphics.
So, graphs with objects that have an `alpha` value (alpha transparency) should be saved as a `pdf` file, NOT `eps`.

Signed-off-by: Jonathan A. Whiteley <jonathan.whiteley@mail.mcgill.ca>
A little more data exploration; Some spatial tests on Fauna data.

Signed-off-by: Jonathan A. Whiteley <jonathan.whiteley@mail.mcgill.ca>