[R-sig-eco] Fitting growth curve in a species accumulation curve (SAC)

Jari Oksanen jari.oksanen at oulu.fi
Mon Nov 28 17:33:43 CET 2011




On 28/11/2011 17:33, "Canning-Clode, Joao" <Canning-ClodeJ at si.edu> wrote:

> Dear list,
> 
> I am kind of new to R. I want to fit the nonlinear Morgan-Mercer-Flodin (MMF)
> growth model in a species accumulation curve (SAC) run with vegan package in
> .R.  I would very much appreciate if you could give some feedback. My first
> question is what's the best approach i) grofit package or ii) nls2
> 
> i) This is what I am doing for grofit:
> 
> install.packages(grofit) # install grofit
> 
> library(grofit)
> library(vegan)
> library(nls2) #loads grofit, vegan and nls2 libraries
> 
> 
> SAC.data<-read.table(file=file.choose(),header=TRUE,sep=",") # choose from
> directory
> 
> SAC.data # shows data
> 
> samples <- SAC.data$Samples #generates samples data
> 
> richness <- SAC.data$richness #generates richness data
> 
> TestRun <-grofit(samples, richness, TRUE) #runs the program for Gompertz
> function
> 
> ##it's not working. I get this warning: Error in if ((dim(time)[1]) !=
> (dim(data)[1])) stop("gcFit: Different number of datasets in data and time") :
>   argument is of length zero##
> 
> 
João,

I don't know 'grofit' package, but when I look at its documentation, your
command does not look correct. The documentation of grofit() describes the
second argument (your 'richness' vector) like this:

"Data frame consisting of 3+n columns, containing three coulumns of
additional information and n columns of growth data corresponding to time.
1. column, character as an experiment identifier; 2. column: character,
additional informa- tion about respecting experiment; 3. column:
concentration of substrate of a compound under which the experiment is
obtained; 4.-(n+3). column: growth data corresponding to the time points in
time."

Please try to follow the documentation before asking here.

On the other hand, vegan has for some time included function fitspecaccum()
which can directly fit some nonlinear models to specaccum() models. These
include gompertz model. You could perhaps try that one.

Cheers, Jari


> 
>   ##Can't go further and add the MMF model##
> 
> 
> 
> ii) other approach:
> 
> SAC<-read.table(file=file.choose(),header=TRUE,sep=",") #choose from directory
> UGE<-specaccum(SAC,method="exact",permutations=1000)
> MMF.formula<-function(a1,b1,c1,d1,x){
> +
> (a1*b1+c1*x^d1)/(b1+x^d1)
> +
> } ## shorthand for creating model formula
> 
> MMF.formula # shows formula
> 
> MMF.fit<-nls(richness~MMF.formula(a,b,c,d,samples),data=UGE,start=list(a=-2,b=
> 3,c=50,d=0.5),trace=TRUE)  # MMF fitted model
> 
> ##not working. Get this message: Error in nls(richness ~ MMF.formula(a, b, c,
> d, samples), data = SAC.data,  :
>   step factor 0.000488281 reduced below 'minFactor' of 0.000976562## starting
> values were just guesses##
> 
> 
> 
> any help would be appreciated
> 
> cheers
> 
> João
> 
> João Canning Clode, Ph.D
> Postdoctoral Fellow
> Marine Invasions Research Lab
> Smithsonian Environmental Research Center
> 647 Contees Wharf Road
> Edgewater, MD 21037
> 
> Email: canning-clodej at si.edu<mailto:canning-clodej at si.edu>
> Web: www.canning-clode.com<http://www.canning-clode.com/>
> 
> 
> 
> On Jun 9, 2010, at 2:19 PM, Falk Hildebrand wrote:
> 
> Dear list,
> I have been using the vegan package to do mds via the metaMDS function, but I
> have some questions regarding the output.
> 1) First off about the rankindex function {vegan}: On my data I always get
> values that I would consider as low, e.g. something in the range of 0.0344 as
> best result (euclidean) and the mean being 0.028 over 7 other metrices. Do
> results as low as this have any relevance? Are there some guidelines as to
> what absolute (or relative) values one should at least obtain to make a
> distinction?
> 2) Is there a way to estimate what percentage of the variation within the data
> can be explained by the mds?
> 3) using envfit {vegan} I get significant p-values for 5 out of 14 env.
> variables/factors (which is of course very nice). However, if I do a CCA and a
> ANOVA (call: anova(cca,by="terms",permu=200)) with the same environmental
> values, usually only one of these same variables/factors ends up being
> significant. I am aware that these are different techniques, but I always
> thought that CCA was supposed to "force" the ordination on the env. vars, so
> why then would I get much better p-values for the unconstrained nmds (I use 5
> dimensions in the nmds)?
> 
> 4) how can I interpret the relation between species and the environmental fit
> in a nmds plot call? The same as sites and env. fit?
> e.g.
> ef=envfit(nmds,environment)
> plot(ef); points(nmds, dis = "species");
> 
> Any help or links to relevant literature would be greatly appreciated.
> best,
> Falk
> 
> 
> 
> _______________________________________________
> R-sig-ecology mailing list
> R-sig-ecology at r-project.org<mailto:R-sig-ecology at r-project.org>
> https://stat.ethz.ch/mailman/listinfo/r-sig-ecology
> 
> _______________________________________________
> R-sig-ecology mailing list
> R-sig-ecology at r-project.org
> https://stat.ethz.ch/mailman/listinfo/r-sig-ecology



More information about the R-sig-ecology mailing list