Diss_Ref_Plot: Plot of references and restoration site dissimilarities

Description Usage Arguments Examples

View source: R/ScriptFonctionsSourcesVpack.r

Description

Display similarity link (previously calculated with ChosseRef::DissRef3 function) between plots and a group of reference plot

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
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
)

Arguments

RELEVES

Variables of the restoration sites data matrix

REF

Variables of reference sites data matrix

DISTANCES

Object resulting from the analysis of the ChosseRef::DissRef3 function.

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 vegan::vegdist function

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. If "DIST_MIN" only reference that have distance to restoration sites lower than the value given in DIST_MIN are drawn.

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

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
# ------------  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)

RenaudJau/Renaudpack2 documentation built on Dec. 12, 2020, 5:14 a.m.