Hi Coline, This is strange: you calculate a distance matrix with daisy(), so the as.matrix() operation should return a symmetric matrix. Symmetric (real) matrices have all their eigenvalues real numbers. Maybe some complex values were produced by daisy()?
Best, Emmanuel ----- Le 30 Mar 20, à 22:58, Coline Boonman <c.boon...@science.ru.nl> a écrit : > Dear reader, > I am working with the pcoa function of ape in R and I got the error message: > “min(D.eig$values) : invalid 'type' (complex) of argument” . > My input data is a distance matrix, which pcoa first converts to a matrix in > the > first line within the code of the function. The error occurs when it wants to > check for negative eigenvalues at the line ‘ min.eig <- min(D.eig$values)’ > I checked D.eig$values and indeed they are complex numbers (imaginary > numbers). > What I don’t understand is why these are created. I never had any issues with > the pcoa function before, and now I change my dataset and this happens. The > distance matrix values range from 0 to 47 and I have species names as rownames > and column names. In the attachment I include a small piece of the dataset and > the code I run. I checked when the error occurs, and I don’t see why the extra > line (2063) gives the error. > I hope someone can help me. > Kind regards, > Coline Boonman > -- > PhD student > Department of Environmental Science > Faculty of Science > Radboud University Nijmegen > P.O. Box 9010, NL-6500 GL Nijmegen > E: c.boon...@science.ru.nl > T: + 31 (0)243653270 / + 31 (0)243653281 (secr.) > http://www.ru.nl/environmentalscience > _______________________________________________ > R-sig-phylo mailing list - R-sig-phylo@r-project.org > https://stat.ethz.ch/mailman/listinfo/r-sig-phylo > Searchable archive at http://www.mail-archive.com/r-sig-phylo@r-project.org/ [[alternative HTML version deleted]] _______________________________________________ R-sig-phylo mailing list - R-sig-phylo@r-project.org https://stat.ethz.ch/mailman/listinfo/r-sig-phylo Searchable archive at http://www.mail-archive.com/r-sig-phylo@r-project.org/