# NOT RUN {
######## Artificial dataset & analysis:
SyntheticTrial <- SyntheticData(SpeciesNum = 20, CommunityNum = 3,
SpCo = NULL, Length = 500,
Parameters = list(a=rep(60, 3),
b=c(0,250,500),
c=rep(0.03,3)),
dev.c = .015, pal = c("#008585", "#FBF2C4", "#C7522B"))
SyntheticEcoFinder <- EcotoneFinder(SyntheticTrial[,-1],
dist = SyntheticTrial$Distance,
method = "all", groups = 3,
standardize = "hellinger",
diversity = "all")
##### Assigning colors to communities:
SyntheticColor <- CommunityColor(SyntheticEcoFinder, pal = "diverge_hcl",
method = "cmeans")
###### Computing the derivatives:
SyntheticSlope <- Slope(SyntheticEcoFinder, method = "all",
axis.number = 2, diversity = "all")
####### Plot the derivative of the FCM with the synthetic species data:
require(colorspace)
plotEcotone(slope = SyntheticSlope, plot.data = TRUE,
plot.method = c("cmeans_slope"), axis.number = 2,
col.method = terrain_hcl(3), col.data = SyntheticColor)
####### Plot the derivative and the FCM:
require(colorspace)
plotEcotone(data = SyntheticEcoFinder, slope = SyntheticSlope,
plot.data = TRUE,
plot.method = c("cmeans", "cmeans_slope"),
axis.number = 2, col.method = terrain_hcl(3),
col.data = SyntheticColor)
# }
Run the code above in your browser using DataLab