Re: [R-sig-phylo] Question on min(D.eig$values) in pcoa function of ape in R

2020-04-06 Thread Emmanuel Paradis
Hi Coline, Matrix symmetry is not about row- and colnames but about testing, for a square matrix X, if X[i, j] == X[j, i] for all i and j = 1, ..., n. I've just had a look at the code of isSymmetrix.matrix() and this is done by testing equality of X and t(X), so effectively making a copy of X

Re: [R-sig-phylo] Question on min(D.eig$values) in pcoa function of ape in R

2020-04-06 Thread Coline Boonman
Dear Emmanual, Thank you for your response! I have checked your code, and I get the following: matrix_dissim_Eucl<-as.matrix(mat_dissim_Eucl) any(is.complex(matrix_dissim_Eucl)) #FALSE isSymmetric.matrix(matrix_dissim_Eucl) # Error: cannot allocate vector of size 811.1Mb So I

Re: [R-sig-phylo] Question on min(D.eig$values) in pcoa function of ape in R

2020-04-06 Thread Emmanuel Paradis
Hi Coline, Actually the test would be: any(is.complex(mat_dissim_Eucl)) And you may also test: isSymmetric(as.matrix(mat_dissim_Eucl)) But it'd very surprising this 2nd test returns FALSE. So if your matrix is real and symmetric, I don't see why you have complex eigenvalues from its

Re: [R-sig-phylo] Question on min(D.eig$values) in pcoa function of ape in R

2020-04-06 Thread Coline Boonman
Dear Emmanual, Thank you for your email. I have been trying to understand what is going on and if your suggestion is correct. However, if I test for complex numbers in my dissimilarity matrix (converted to a matrix: is.complex(as.matrix(mat_dissim_Eucl)) ) R gives me the result FALSE. That