# NOT RUN {
# }
# NOT RUN {
data(eco.test)
require(ggplot2)
###############################
## Omnidirectional correlogram
###############################
corm <- eco.cormantel(M = dist(eco[["P"]]), size=1000,smax=7, XY = eco[["XY"]],
nsim = 99)
eco.plotCorrelog(corm)
corm <- eco.cormantel(M = dist(eco[["P"]]), size=1000,smax=7, XY = eco[["XY"]],
nsim = 99, test = "bootstrap")
eco.plotCorrelog(corm)
#######################################################
## A directional approach based in bearing correlograms
#######################################################
corm_b <- eco.cormantel(M = dist(eco[["P"]]), size=1000,smax=7, XY = eco[["XY"]],
nsim = 99, angle = seq(0, 170, 10))
# use eco.plotCorrelogB for this object
eco.plotCorrelogB(corm_b)
# plot for the first distance class,
use a number between 1 and the number of classes to select the corresponding class
eco.plotCorrelogB(corm_b, interactivePlot = FALSE, var = 1)
# partial Mantel correlogram
corm <- eco.cormantel(M = dist(eco[["P"]]), MC = dist(eco[["E"]]),
size=1000, smax=7, XY = eco[["XY"]], nsim = 99)
eco.plotCorrelog(corm)
# standard correlogram plots support the use of ggplot2 syntax
require(ggplot2)
mantelplot <- eco.plotCorrelog(corm, interactivePlot = FALSE)
mantelplot <- mantelplot + theme_bw() + theme(legend.position="none")
mantelplot
#-----------------------
# ACCESSORS USE EXAMPLE
#-----------------------
# the slots are accesed with the generic format
# (ecoslot. + name of the slot + name of the object).
# See help("EcoGenetics accessors")
ecoslot.OUT(corm) # slot OUT
ecoslot.BREAKS(corm) # slot BREAKS
# }
# NOT RUN {
# }
Run the code above in your browser using DataCamp Workspace