# NOT RUN {
# }
# NOT RUN {
data(eco.test)
### Ordinary Mantel test ###
eco.mantel(d1 = dist(eco[["P"]]), d2 = dist(eco[["E"]]), nsim = 99)
### Partial Mantel test ###
pm <- eco.mantel(d1 = dist(eco[["P"]]), d2 = dist(eco[["E"]]),
dc = dist(eco[["XY"]]), nsim = 99)
### Truncated Mantel test ###
# checking threshold in a correlogram:
corm <- eco.cormantel(M = dist(eco[["P"]]), XY = eco[["XY"]], nsim = 99)
eco.plotCorrelog(corm)
# Correlation is around 0 when distance between points is > 5
# creating a weights object for truncation
con <- eco.weight(eco@XY, method="circle", d2=5)
# compute a truncated mantel test
eco.mantel(dist(eco[["P"]]), dist(eco[["XY"]]), con=con)
### Directional Mantel test ###
# analyzing with a Mantel test, in a direction of 35 degrees counterclockwise from E.
con2 <- eco.bearing(XY = eco[["XY"]], theta = 37)
eco.mantel(dist(eco[["P"]]), dist(eco[["XY"]]), con = con2)
#-----------------------
# ACCESSORS USE EXAMPLE
#-----------------------
# the slots are accessed with the generic format
# (ecoslot. + name of the slot + name of the object).
# See help("EcoGenetics accessors")
ecoslot.OBS(pm) # slot OBS (observed value)
ecoslot.PVAL(pm) # slot PVAL (P-value)
# }
# NOT RUN {
# }
Run the code above in your browser using DataLab