source("distr.R") #type = 1 geometric (param is the proportion of neighbouring species) # = 2 lognormal (param is the standard deviation) # = 3 Tokeshi power fraction # = 4 broken stick (fully random) type = 2 param = 0.9 pool_size = 100 #plotting distribution a=distr(type,param,pool_size) plot(a,type="l",lwd=2, log="y",xlab="Species",ylab="Log abundance" ) #comparing parameters of one distribution type = 2 param = 0.9 a=distr(type,param,pool_size) param = 1 b=distr(type,param,pool_size) param = 1.1 c=distr(type,param,pool_size) out = cbind(a,b,c) matplot(out,type="l",lwd=2, lty=1, log="y", col=c("black","blue","green"),xlab="Species",ylab="Log abundance") #comparing distributions type = 2 param = 1 a=distr(type,param,pool_size) type = 4 param = 1 # for type = 4 the value has no effect b=distr(type,param,pool_size) out = cbind(a,b) matplot(out,type="l",lwd=2, lty=1, log="y", col=c("black","blue","green"),xlab="Species",ylab="Log abundance")