View source: R/ScriptFonctionsSourcesVpack.r
Diss_Ref_Plot | R Documentation |
Display similarity link (previously calculated with ChosseRef::DissRef3
function) between plots and a group of reference plot
Diss_Ref_Plot(
RELEVES,
REF,
DISTANCES,
METHOD = "euclidean",
COUL_RELEVES = 2,
COUL_Rel_variable = TRUE,
COUL_REF = 1,
COUL_Seg = "#9C8809",
COUL_Seg_variable = TRUE,
LINK_NUMBER = "absent",
N_REF = "absent",
DIST_MIN = "absent",
VAL_DIST = TRUE,
DECAL = 0
)
RELEVES |
Variables of the restoration sites data matrix |
REF |
Variables of reference sites data matrix |
DISTANCES |
Object resulting from the analysis of the |
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 |
COUL_RELEVES |
Color of RELEVES names |
COUL_Rel_variable |
If TRUE: color change for each RELEVES |
COUL_REF |
Color of REF names |
COUL_Seg |
Color of links |
COUL_Seg_variable |
If TRUE: colors change for each link |
LINK_NUMBER |
Number of link drawn. If "N_REF" then for each RELEVES, the number of link drawn is the number given in |
N_REF |
Number of REF to display a link between REF and RELEVES |
DIST_MIN |
Minimum distance value to draw a link between REF and RELEVES |
VAL_DIST |
Providing or not (TRUE by default) the distance value display |
DECAL |
Distance between the printing of the distance and the link |
# ------------ 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.