[R-sig-eco] Vegan fisher.alpha error

Peter Solymos solymos at ualberta.ca
Tue Jun 1 15:36:34 CEST 2010


Kang Min,

The error comes from the function 'fisherfit' that uses 'nlm' to
minimize the negative log likelihood for the Fisher's log-series.
Numerical optimization does not tolerate missing values. This code
reproduces your error:

> library(vegan)
> data(BCI)
> BCI[1,1] <- NA
> fisher.alpha(BCI)
Error in nlm(Dev.logseries, n.r = n.r, p = p, N = N, hessian = TRUE, ...) :
  missing value in parameter

So try to exclude problematic rows:

> fisher.alpha(BCI[rowSums(is.na(BCI))==0,])

Cheers,

Peter

Péter Sólymos
Alberta Biodiversity Monitoring Institute
and Boreal Avian Modelling project
Department of Biological Sciences
CW 405, Biological Sciences Bldg
University of Alberta
Edmonton, Alberta, T6G 2E9, Canada
Phone: 780.492.8534
Fax: 780.492.7635
email <- paste("solymos", "ualberta.ca", sep = "@")


On Tue, Jun 1, 2010 at 6:20 AM, Kang Min <ngokangmin at gmail.com> wrote:
>
> Hi,
>
> I have an error with fisher.alpha from the vegan package.
>
>> fisher.alpha(data[[1]])
> Error in nlm(Dev.logseries, n.r = n.r, p = p, N = N, hessian =
> TRUE, ...) :
>  missing value in parameter
>
> I am trying to find fisher alpha for a list of 100 data frames, and I
> tried it on individual data frames in the list, which gave me the
> error above.
> I have every data frame in the same format as the example data BCI,
> species as column names and quadrats as row names.
>
> Can anyone explain what the error is about? Thanks a lot.
>
> Kang Min
> --
> View this message in context: http://r-sig-ecology.471788.n2.nabble.com/Vegan-fisher-alpha-error-tp5125719p5125719.html
> Sent from the r-sig-ecology mailing list archive at Nabble.com.
>
> _______________________________________________
> 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