Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tab_model() table for lme4 models generates a table processing warning in Quarto #958

Open
remlapmot opened this issue Jan 13, 2025 · 0 comments

Comments

@remlapmot
Copy link

remlapmot commented Jan 13, 2025

Thanks so much for several great packages.

I have spotted that tables generated by tab_model() run on a multilevel model fit from the lme4 package generate a warning in Quarto which I was wondering whether you are aware of. Here's a reprex.

Save the following as say example.qmd

---
format:
  html:
    embed-resources: true
---
  
```{r}
library(sjPlot)
library(lme4)
fm1 <- lmer(Reaction ~ Days + (Days | Subject), sleepstudy)
tab_model(fm1)
```

Then render with (I'm on the current versions of Quarto 1.6.40 and sjPlot 2.8.17)

quarto::quarto_render(input = 'example.qmd')

or at the command line with

quarto render example.qmd

and in the output you'll see the following which is caused by the tab_model() table.

WARNING (/Applications/quarto/share/filters/main.lua:9319) Unable to parse table from raw html block: skipping.

It turns out that Quarto has a feature to disabled their processing of html tables, by adding the following attribute to the table html-table-processing: none.

https://quarto.org/docs/authoring/tables.html#disabling-quarto-table-processing

So simply adding that to the YAML options of the Quarto document (or to the specific code chunk options) avoids the warning.

It can be done programmatically by package authors

https://quarto.org/docs/authoring/tables.html#library-authors

I don't know enough html to know why Quarto doesn't like these tables but I note that it doesn't give the warning if I disable the items in the bottom of the table, e.g.

---
format:
  html:
    embed-resources: true
---
  
```{r}
library(sjPlot)
library(lme4)
fm1 <- lmer(Reaction ~ Days + (Days | Subject), sleepstudy)
tab_model(fm1, show.re.var = FALSE, show.obs = FALSE, show.r2 = FALSE, show.icc = FALSE, show.ngroups = FALSE)
```

So I thought I'd check whether you are aware of this.

I didn't check whether this warning is generated by other types of model.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant