Running examples in 'phyr-Ex.R' failed
The error most likely occurred in:

> ### Name: pglmm.compare
> ### Title: Phylogenetic Generalized Linear Mixed Model for Comparative Data
> ### Aliases: pglmm.compare
> ### Keywords: regression
> 
> ### ** Examples
> 
> 
> ## Illustration of `pglmm.compare` with simulated data
> 
> # Generate random phylogeny
> 
> library(ape)
> 
> n <- 100
> phy <- compute.brlen(rtree(n=n), method = "Grafen", power = 1)
> 
> # Generate random data and standardize to have mean 0 and variance 1
> X1 <- rTraitCont(phy, model = "BM", sigma = 1)
> X1 <- (X1 - mean(X1))/var(X1)
> 
> # Simulate binary Y
> sim.dat <- data.frame(Y=array(0, dim=n), X1=X1, row.names=phy$tip.label)
> sim.dat$Y <- ape::binaryPGLMM.sim(Y ~ X1, phy=phy, data=sim.dat, s2=1,
+                              B=matrix(c(0,.25),nrow=2,ncol=1), nrep=1)$Y
> 
> # Fit model
> pglmm.compare(Y ~ X1, family="binomial", phy=phy, data=sim.dat)
Generalized linear mixed model for binomial data fit by restricted maximum likelihood

Call:Y ~ X1

logLik    AIC    BIC 
-57.59 123.19 129.03 

Phylogenetic random effects variance (s2):
   Variance Std.Dev
s2  0.04959  0.2227

Fixed effects:
              Value Std.Error Zscore    Pvalue    
(Intercept) 1.00446   0.26263 3.8247 0.0001309 ***
X1          0.26145   0.27044 0.9667 0.3336768    
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

> 
> # Compare with `binaryPGLMM`
> ape::binaryPGLMM(Y ~ X1, phy=phy, data=sim.dat)


Call:Y ~ X1

Random effect (phylogenetic signal s2):
       s2     Pr
1 0.04448 0.4384

Fixed effects:
              Value Std.Error Zscore    Pvalue    
(Intercept) 1.00516   0.25935 3.8757 0.0001063 ***
X1          0.26456   0.26826 0.9862 0.3240275    
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

> 
> # Compare with `phyloglm`
> summary(phylolm::phyloglm(Y ~ X1, phy=phy, data=sim.dat))

Call:
phylolm::phyloglm(formula = Y ~ X1, data = sim.dat, phy = phy)
       AIC     logLik Pen.logLik 
    150.11     -72.06     -71.57 

Method: logistic_MPLE
Mean tip height: 1
Parameter estimate(s):
alpha: 0.8193869 

Coefficients:
            Estimate  StdErr z.value p.value  
(Intercept)  2.25302 1.25590  1.7939 0.07282 .
X1           1.78038 0.77642  2.2931 0.02184 *
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

Note: Wald-type p-values for coefficients, conditional on alpha=0.8193869

> 
> # Compare with `glm` that does not account for phylogeny
> summary(glm(Y ~ X1, data=sim.dat, family="binomial"))

Call:
glm(formula = Y ~ X1, family = "binomial", data = sim.dat)

Deviance Residuals: 
    Min       1Q   Median       3Q      Max  
-1.8575  -1.4377   0.7416   0.7873   0.9672  

Coefficients:
            Estimate Std. Error z value Pr(>|z|)    
(Intercept)   1.0119     0.2287   4.424 9.67e-06 ***
X1            0.2945     0.2469   1.192    0.233    
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

(Dispersion parameter for binomial family taken to be 1)

    Null deviance: 116.65  on 99  degrees of freedom
Residual deviance: 115.20  on 98  degrees of freedom
AIC: 119.2

Number of Fisher Scoring iterations: 4

> 
> # Compare with logistf() that does not account
> # for phylogeny but is less biased than glm()
> logistf::logistf(Y ~ X1, data=sim.dat)
Error in library.dynam(lib, package, package.lib) : 
  DLL 'dplyr' not found: maybe not installed for this architecture?
Calls: :: ... loadNamespace -> namespaceImport -> loadNamespace -> library.dynam
Execution halted