bug in "physignal.z()" geomorph 4.0.10

29 views
Skip to first unread message

Stylianos Koutalis

unread,
Jun 1, 2025, 9:04:13 AMJun 1
to geomorph R package

Dear all,

Today I encountered a potential bug that did not occur last year. When running the physignal.z() function with univariate data, Csize for various Species (using the "front" lambda optimization) in the form of an [n, 1] matrix, I received the error: "Error in Y[d, ] : incorrect number of dimensions". 

This error did not occur with the same script and data in a previous analysis. The physignal() function still works fine on the same univariate input. To work around the issue, I duplicated the univariate data as a second column - new.matrix <- cbind(data, data) - and then ran physignal.z() (using "front" lambda optimization again), which reproduced my original results.

I'm reporting this as a possible bug since the behavior has changed. Thank you very much for your time and attention!

Best regards,
Stelios

Mike Collyer

unread,
Jun 1, 2025, 11:43:45 AMJun 1
to geomorph R package
Dear Stelios,

I believe if you update both RRPP and geomorph from Github (addresses in description files), this issue has already been addressed.  It was caused by R converting a single-column matrix into a vector, even after it was established as a matrix.  (This appears to be due to recent R updates, not the physignal.z function.)  This is why your fix worked because it forces R to retain a matrix.  We added a line of code to assure retention of a matrix, so it should work now.  Please let us know after updating if still does not work.

Best,
Mike


--
You received this message because you are subscribed to the Google Groups "geomorph R package" group.
To unsubscribe from this group and stop receiving emails from it, send an email to geomorph-r-pack...@googlegroups.com.
To view this discussion, visit https://groups.google.com/d/msgid/geomorph-r-package/8971e4d5-6775-46c5-8824-41e3c2f6f30dn%40googlegroups.com.

Message has been deleted

Stylianos Koutalis

unread,
Nov 21, 2025, 2:51:51 AM (8 days ago) Nov 21
to geomorph R package
  Dear Professor, 

Good morning. I had the same problem again, this time with the overall result of the physignal.z function. The time we discussed the issue with the bug, which indeed was solved when i  updated (or manually go around) RRPP,  now, the same dataset, results in this :

> PS.shape.z <- physignal.z(A = extant, phy = tree.all, iter = 10000, lambda = "front") 

> print(PS.shape.z) 


Call: physignal.z(A = extant, phy = tree.all, lambda = "front", iter = 10000) 


Evaluation of phylogenetic signal effect size 

Optimization method: front 

Optimization performed in 11 data dimensions. 

The scaling parameter, lambda, was optimized at 0. 

This means that the log-likelihood was invariant across permutations 

and there is no phylogenetic signal in the data.


The same dataset, when the 'front' optimization is removed, works as expected. I mean, this works now as well, but I'm unable to recreate my original result.

Thank you for your time! Looking forward to hearing from you.


Best,

Stelios


Reply all
Reply to author
Forward
0 new messages