easystats / insight

:crystal_ball: Easy access to model information for various model objects
https://easystats.github.io/insight/
GNU General Public License v3.0
404 stars 39 forks source link

get_variance() returns NULL when R package site is built via github actions #928

Open matschmitz opened 2 months ago

matschmitz commented 2 months ago

When building the site of a simple testing R package locally and rendering the article, the insight::get_variance() function works as expected. However, when building the site via GitHub Actions, the function returns NULL.

Steps to Reproduce:

Locally, render the following code in an article and observe that get_variance() works correctly:

library(pkgtest)
library(brms)
library(insight)

mdl <- brms::brm(mpg ~ hp + (1 | cyl), data = mtcars, cores = 4)

insight::get_variance(mdl)
#> $var.fixed 
#> [1] 4.873527 

#> $var.random
#> [1] 22.39223 

#> $var.residual 
#> [1] 8.502559 
#> attr(,"class") 
#> [1] "insight_aux" "numeric"

#> $var.distribution 
#> [1] 8.502559 
#> attr(,"class") #> [1] "insight_aux" "numeric"

#> $var.dispersion 
#> [1] 0 
#> $var.intercept 
#> cyl
#> 22.39223 

When the same article is rendered via GitHub Actions, the result of get_variance() is NULL

Local Build:

GitHub Actions:

There may be an environment or package dependency issue specific to GitHub Actions.

strengejacke commented 2 months ago

As a workaround, does it help if you provide the null-model (using the null_model argument)?