DissRef3 | R Documentation |
Calculate similarity between plots and a group of reference plot
DissRef3(RELEVES, REF, METHOD = "bray", BINARY = FALSE, DUPLICATES = TRUE)
RELEVES |
Variables of the restoration sites data matrix |
REF |
Variables surveys of reference sites data matrix |
METHOD |
Dissimilarity index, partial match to "manhattan", "euclidean", "canberra", "clark", "bray", "kulczynski", "jaccard", "gower", "altGower", "morisita", "horn", "mountford", "raup", "binomial", "chao", "cao" or "mahalanobis". Cf |
BINARY |
(FALSE by default) If TRUE, data is converted to binary data |
DUPLICATES |
(TRUE by default) Are REF plots also included in RELEVES data? |
Diss_Mean |
average dissimilarity by RELEVES |
Diss_Min |
minimal dissimilarity by RELEVES |
RelRef_order |
list of REF names in ascending order of dissimilarity for each RELEVES |
DistRef_order |
list of REF distance values in ascending order of dissimilarity for each RELEVES |
# ------------ Creating the data needed for the example --------------------
library(vegan)
data("dune") #downloading of dune data (cf vegan)
data("dune.env") #downloading of dune.env data (cf vegan)
# keeping only the numeric variables :
dune.env <- data.frame(A1 = dune.env$A1,
Moisture = as.numeric(as.vector(dune.env$Moisture)),
Manure = as.numeric(as.vector(dune.env$Manure)))
# Creating a vector indicating which plots are the potential references and which ones are the restored sites
sites <- factor(c(rep("Rest",5),rep("Ref",15)))
# Creating a vector with the plot names
sites_names <- paste(sites,c(1:5,1:15))
#Poviding names to rows (useful for the outputs)
row.names(dune.env) <- sites_names
row.names(dune) <- sites_names
dune.envRest <- dune.env[sites=="Rest",]
dune.envRef <- dune.env[sites=="Ref",]
# -------------- Calculating reference dissimilarities ---------------------
Distances <- DissRef3(RELEVES = dune.envRest, REF = dune.envRef, METHOD = "euclidean", DUPLICATES = FALSE)
Distances
# ---------------- Plotting reference dissimilarities ----------------------
Diss_Ref_Plot(RELEVES = dune.envRest, REF = dune.envRef, DISTANCES = Distances, LINK_NUMBER = "N_REF", N_REF = 3)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.