## Testing the functions
## Load the functions in your working directory
source("funcoes_logser.r")
source("funcoes_lognorm.r")
source("funcoes_niche-part.r")
source("funcoes_rankplots.r")
## Package untb to generate log-series communities
library(untb)
## Package vegan for rank-ab plots & model fitting
library(vegan)
## Other required packages
library(bbmle)
library(MASS)
library(poilog)
library(distr)
## Generating a logseries community: 10000 individuals, 100 species
ex1 <- fisher.ecosystem(10000,100,10000)
## Rank-abund plot from vegan package
plot(radfit(ex1))
## Adding the logseries curve to the plot
curve(rad.logserf(ex1)(x),add=T, col="darkorange",lwd=2, lty=2)
## My rank-abundance plot
radplot(ex1)
