geomorphR/geomorph

ProcD.pgls - error w/ instances of single observations?

Closed this issue · 2 comments

Hello all -

After updating R and the Geomorph package, I'm having some issues with running ProcD.pgls with data frames involving a single instance of a given observation, giving me the following error code:

"Error in LM$X %*% LM$gls.coefficients : non-conformable arguments"

I should note that my code appeared to run successfully prior to updating my packages, and that running ProcD.lm with an identical dataset works just fine. Unless I'm committing some statistical faux-pas I'm unaware of, I suspect this issue is similar to this post, which seems to involve GLS and some aspect of RRPP as well:

R version: 4.0.5
Geomorph version: 4.0.0
RRPP version: 1.0.0

library(geomorph)
data(plethspecies)

#set up single/multi observations
discretes <- data.frame(single_instance = c("1", "1", "1", "1", "1", "2", "2", "2", "3"), 
                             multi_instance = c("1", "1", "1", "1", "1", "2", "2", "3", "3"))

Y.gpa<-gpagen(plethspecies$land)    
plethgdf <- geomorph.data.frame(Y.gpa, phy = plethspecies$phy, single = discretes$single_instance,
                                multi = discretes$multi_instance  )

#Run with multiple observations of all characters  (works)
pleth.lm <- procD.lm(coords ~ Csize * multi, data = plethgdf)
pleth.pgls <- procD.pgls(coords ~ Csize * multi, phy = phy, data = plethgdf)
                        
#Run with one single observation of one character (issues in pgls only)
pleth.lm <- procD.lm(coords ~ Csize * single, data = plethgdf)
pleth.pgls <- procD.pgls(coords ~ Csize * single, phy = phy, data = `plethgdf)'

Let me know if there's anything else I can provide that might be helpful!

~Ben

Hi Mike -

Ah yes that would do it, wouldn't it - fixing the formula indeed runs without a hitch, apologies for not catching that sooner! Thank you for the help and the quick response!

Best,
~Ben