if (FALSE) {
#Time consuming
require(adiv)
data(duneFVG)
data(duneFVG.xy)
dist_sp<-dist(duneFVG.xy$tot.xy,'euclidean')
## Spatial explicit rarefaction with HCDT
rare<-rare_alpha(duneFVG$total,dist_sp,q=2,random=99,spatial=TRUE)
## Non-spatially explicit rarefaction with Hill
rare1<-rare_alpha(duneFVG$total,dist_sp,method='hill',q=2,mean=TRUE)
##fun_div with the list of arguments passed
#to set the argument, digit the correspondent number
#digit the number correspondent to "stop" when the process is complete
#remember to load the package that contain the function you want to exploit
#Example with the function speciesdiv() of adiv package
a<-list(NA,'Shannon')
names(a)<-c('comm','method')
rare2<-rare_alpha(duneFVG$total,method="fun_div",random=999,fun_div='speciesdiv',args=a,mean
=TRUE)
rare3<-rare_alpha(duneFVG$total,dist_sp,method="fun_div",fun_div='speciesdiv',args=a,spatial
=TRUE,mean=TRUE)
##fun_div without the list of arguments passed (verbose=TRUE)
rare4<-rare_alpha(duneFVG$total,method="fun_div",random=999,fun_div='speciesdiv',verbose=TRUE,mean
=TRUE)
rare5<-rare_alpha(duneFVG$total,dist_sp,method="fun_div",fun_div='speciesdiv',verbose=TRUE,spatial
=TRUE,mean=TRUE)
}
Run the code above in your browser using DataLab