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

> ### Name: glmPQL
> ### Title: Compute PQL estimates for fixed effects from a generalized
> ###   linear model.
> ### Aliases: glmPQL
> 
> ### ** Examples
> 
> 
> # Load the datasets package for example code
> library(datasets)
> library(dplyr)

Attaching package: 'dplyr'

The following objects are masked from 'package:stats':

    filter, lag

The following objects are masked from 'package:base':

    intersect, setdiff, setequal, union

> 
> # We'll model the number of world changing discoveries per year for the
> # last 100 years as a poisson outcome. First, we set up the data
> 
> dat = data.frame(discoveries) %>% mutate(year = 1:length(discoveries))
> 
> # Fit the GLM with a poisson link function
> mod <- glm(discoveries~year+I(year^2), family = 'poisson', data = dat)
> 
> # Find PQL estimates using the original GLM
> mod.pql = glmPQL(mod)
> 
> # Note that the PQL model yields a higher R Squared statistic
> # than the fit of a strictly linear model. This is attributed
> # to correctly modelling the distribution of outcomes and then
> # linearizing the model to measure goodness of fit, rather than
> # simply fitting a linear model
> 
> summary(mod.pql)

Call:
glm(formula = discoveries ~ year + I(year^2), family = "poisson", 
    data = dat)

Residuals:
    Min      1Q  Median      3Q     Max 
-1.0008 -0.4555 -0.1686  0.2987  2.1281 

Coefficients:
              Estimate Std. Error t value Pr(>|t|)    
(Intercept)  6.902e-01  2.068e-01   3.338 0.001198 ** 
year         3.636e-02  9.450e-03   3.848 0.000213 ***
I(year^2)   -4.304e-04  9.065e-05  -4.748 7.09e-06 ***
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

Residual standard error: 0.6755 on 97 degrees of freedom
Multiple R-squared:  0.2467,	Adjusted R-squared:  0.2312 
F-statistic: 15.88 on 2 and 97 DF,  p-value: 1.078e-06

> summary(linfit <- lm(discoveries~year+I(year^2), data = dat))

Call:
lm(formula = discoveries ~ year + I(year^2), data = dat)

Residuals:
    Min      1Q  Median      3Q     Max 
-4.0552 -1.2568 -0.4232  0.9892  8.2440 

Coefficients:
              Estimate Std. Error t value Pr(>|t|)    
(Intercept)  2.0870996  0.6338195   3.293 0.001384 ** 
year         0.0921713  0.0289673   3.182 0.001966 ** 
I(year^2)   -0.0010763  0.0002779  -3.873 0.000195 ***
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

Residual standard error: 2.071 on 97 degrees of freedom
Multiple R-squared:  0.1732,	Adjusted R-squared:  0.1561 
F-statistic: 10.16 on 2 and 97 DF,  p-value: 9.864e-05

> 
> r2beta(mod.pql)
Error in h(simpleError(msg, call)) : 
  error in evaluating the argument 'a' in selecting a method for function 'solve': 'crossprod' is not an exported object from 'namespace:Matrix'
Calls: r2beta ... lapply -> FUN -> <Anonymous> -> .handleSimpleError -> h
Execution halted