require(Ternary)
# Simulates a custom community time series using 'comTS()':
z <- comTS(nsp = 10, ny = 30, even = 0.6, mvs = 1.5, sync = "0")
# Runs the partitioning of the community coefficient of variation:
x <- partitionR(z)
# Plots the relative contributions
oldpar <- par(no.readonly = TRUE)
par(mar = c(0, 0, 0, 0))
ternStab(x)
# Adds a second community on the ternary plot
z2 <- comTS(nsp = 15, ny = 30, even = .7, mvs = 1.1, sync = "1")
x2 <- partitionR(z2)
ternStab(x2, add = TRUE, col = "red")
par(oldpar)
Run the code above in your browser using DataLab