You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
First, thanks for this awesome R package! It's allowing me to do things that I haven't been able to do with any other GLMM package.
I'm trying to use pglmm_plot_ranef() to extract the random effects predictions on simulated data and I noticed that if I name my "species" phylogeny variable anything other than "sp" that it returns the error:
Error in [.data.frame(data, , sp.var) : undefined columns selected
I ran into this problem with a simulated data set, but it seems to be reproducible running the "### Detailed analysis showing covariance matrices ###" example under the pglmm() documentation. If I run this simulation but change the name of "sp" in the data frame "d" to anything else (and then change the name in the calls to pglmm and pglmm_plot_ranef, of course), then pglmm_plot_ranef will return the error (even though pglmm runs fine). E.g. at these lines change the name and run:
d <- data.frame(species= rep(phy$tip.label, times = nsite),
site = rep(1:nsite, each = nspp))
d$Y <- Y.sp + Y.site + Y.attract + Y.e
#Works
pglmm(Y ~ 1 + (1|species__) + (1|site) + (1|species__@site), data = d, cov_ranef = list(species = phy))
#Does not
re <- pglmm_plot_ranef(Y ~ 1 + (1|species__) + (1|site) + (1|species__@site), data = d,
cov_ranef = list(species= phy), show.image = FALSE, show.sim.image = FALSE)
Am I missing something?
Thanks.
The text was updated successfully, but these errors were encountered:
That worked! Was that in the documentation somewhere and I missed it? Sorry
if it was.
It has been awhile! It's good to hear from you. Thanks for the fast reply!
Best,
Jacob
On Fri, Mar 26, 2021 at 10:37 AM Daijiang Li ***@***.***> wrote:
Hi Jacob!
Can you try pglmm_plot_ranef(sp.var = "species") and see whether that
work?
Btw, it has been several years since our last interaction! Hope to catch
up with you sometime soon.
Best,
Daijiang
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#65 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AHOVEWXSNPBILSA46IBRONTTFTA4ZANCNFSM4Z3ZRP5Q>
.
Hello,
First, thanks for this awesome R package! It's allowing me to do things that I haven't been able to do with any other GLMM package.
I'm trying to use
pglmm_plot_ranef()
to extract the random effects predictions on simulated data and I noticed that if I name my "species" phylogeny variable anything other than "sp" that it returns the error:Error in
[.data.frame
(data, , sp.var) : undefined columns selectedI ran into this problem with a simulated data set, but it seems to be reproducible running the "### Detailed analysis showing covariance matrices ###" example under the
pglmm()
documentation. If I run this simulation but change the name of "sp" in the data frame "d" to anything else (and then change the name in the calls to pglmm and pglmm_plot_ranef, of course), then pglmm_plot_ranef will return the error (even though pglmm runs fine). E.g. at these lines change the name and run:Am I missing something?
Thanks.
The text was updated successfully, but these errors were encountered: