Running examples in ‘HLMdiag-Ex.R’ failed
The error most likely occurred in:

> base::assign(".ptime", proc.time(), pos = "CheckExEnv")
> ### Name: hlm_resid.default
> ### Title: Calculating residuals from HLMs
> ### Aliases: hlm_resid.default hlm_resid.lmerMod hlm_resid hlm_resid.lme
> ### Keywords: models regression
> 
> ### ** Examples
> 
> data(sleepstudy, package = "lme4")
> fm.lmer <- lme4::lmer(Reaction ~ Days + (Days|Subject), sleepstudy)
> fm.lme <- nlme::lme(Reaction ~ Days, random = ~Days|Subject, sleepstudy)
> 
> # level-1 and marginal residuals
> fm.lmer.res1 <- hlm_resid(fm.lmer) ## raw level-1 and mar resids
> fm.lmer.res1
# A tibble: 180 × 10
      id Reaction  Days Subject  .resid .fitted .ls.resid .ls.fitted .mar.resid
   <dbl>    <dbl> <dbl> <fct>     <dbl>   <dbl>     <dbl>      <dbl>      <dbl>
 1     1     250.     0 308       -4.10    254.      5.37       244.      -1.85
 2     2     259.     1 308      -14.6     273.     -7.25       266.      -3.17
 3     3     251.     2 308      -42.2     293.    -36.9        288.     -21.5 
 4     4     321.     3 308        8.78    313.     12.0        309.      38.6 
 5     5     357.     4 308       24.5     332.     25.6        331.      63.6 
 6     6     415.     5 308       62.7     352.     61.7        353.     111.  
 7     7     382.     6 308       10.5     372.      7.42       375.      68.0 
 8     8     290.     7 308     -101.      391.   -106.         397.     -34.5 
 9     9     431.     8 308       19.6     411.     12.3        418.      95.4 
10    10     466.     9 308       35.7     431.     26.3        440.     121.  
# … with 170 more rows, and 1 more variable: .mar.fitted <dbl>
> fm.lme.std1 <- hlm_resid(fm.lme, standardize = TRUE) ## std level-1 and mar resids
> fm.lme.std1
# A tibble: 180 × 10
      id Reaction  Days Subject .std.resid .fitted .std.ls.resid .ls.fitted
   <dbl>    <dbl> <dbl> <fct>        <dbl>   <dbl>         <dbl>      <dbl>
 1     1     250.     0 308         -0.160    254.         0.139       244.
 2     2     259.     1 308         -0.571    273.        -0.175       266.
 3     3     251.     2 308         -1.65     293.        -0.851       288.
 4     4     321.     3 308          0.343    313.         0.268       309.
 5     5     357.     4 308          0.958    332.         0.566       331.
 6     6     415.     5 308          2.45     352.         1.36        353.
 7     7     382.     6 308          0.412    372.         0.166       375.
 8     8     290.     7 308         -3.95     391.        -2.45        397.
 9     9     431.     8 308          0.766    411.         0.296       418.
10    10     466.     9 308          1.39     431.         0.680       440.
# … with 170 more rows, and 2 more variables: .chol.mar.resid <dbl>,
#   .mar.fitted <dbl>
> 
> # level-2 residuals
> fm.lmer.res2 <- hlm_resid(fm.lmer, level = "Subject") ## level-2 ranefs
Error in nchar(xs) : 
  number of characters is not computable in "bytes" encoding, element 1
Calls: hlm_resid ... <Anonymous> -> clii__xtext -> ansi_strwrap -> lapply -> FUN
Execution halted