View source: R/Site Selection.R
site.match | R Documentation |
Methods for matching test sites with nearest neighbour reference sites based on ecological similarity. The Assessment by Nearest-Neighbour Analysis (ANNA) and Redundancy Analysis ANNA (RDA-ANNA) are implimented as in (http://www.bioone.org/doi/abs/10.1086/678702). Ecological distance are calculated as Euchlidean distance across significant ordination axis. Axis are standardized and weighted according the proportion of variance explained. Significance of axis is determined by the broken-stick method for ANNA and a permutation test for RDA-ANNA.
site.match(Test, Reference, k = NULL, adaptive = T, ad.factor = 2,
ad.constant = 1, RDA.reference = NULL)
Test |
Vector of environmental variables at Test site |
Reference |
Data frame of environmental Variables at Reference sites |
k |
Numeric, the numer of nearest neighbour reference sites to find. Ignored if NULL |
adaptive |
Logical, whether to use adaptive breaks to select nearest neighbour reference sites. |
ad.factor |
Power factor used in the inverse-power function if adaptive==T |
ad.constant |
Constant factor used in the inverse-power function if adaptive==T |
RDA.reference |
Data frame containing indicator metric data at reference sites. Row names must match with Reference. If it is supplied the function will perform RDA-ANNA, otherwise ANNA. |
An option for adaptive selection of k of based on dynamic 1-dimensional k-means clustering implimented in Ckmeans.1d.dp
is available, otherwise k must be supplied.
$final.dist - Vector containing nearest neighbour reference sites to test site as well as the ecological distance of the test site to each reference site.
$method - Whether ANNA or RDA-ANNA was used
$k - The number of reference sites requested or "Adaptive"
$all.dist - The ecological distance of all reference sites to the test site
$ref.scores - Ordination axis scores of reference sites
$test.scores - Ordination axis scores of test site
#load datasets
data(YKEnvData,envir = environment()) #Biological dataset
data(YKBioData,envir = environment()) #Environmental dataset
#Calculate indicator metrics from raw biological data
bio.data.test<-benth.met(YKBioData,2,2)
#Extract just the summary metrics
bio.data<-bio.data.test$Summary.Metrics
#standardize row names between datasets
rownames(YKEnvData)<-bio.data.test$Site.List
#Match a test site (#201) to the nearest neighbour reference set
nn.sites<-site.match(YKEnvData[201,-c(1)],YKEnvData[1:118,-c(1)],k=NULL,adaptive=T)
#Evaluate nearest neighbour selections
plot(nn.sites)
sitematch.plot(nn.sites)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.