sjPlot 包(http://www.strengejacke.de/sjPlot)具有 tab_model() 函数,可以为许多模型类型创建漂亮的 html 表格。我正在尝试在 Overleaf 中使用这些表格,但我不确定如何“轻松”将它们转换为乳胶而不丢失一些格式等。
\n我的非常hacky方法如下(发布在https://github.com/Rapporter/pander/issues/298)。
\n任何改善这一点的帮助将不胜感激。
\n下面是一个可重现的示例:
\nlibrary(lme4)\nlibrary(sjPlot)\nlibrary(XML)\nlibrary(RCurl)\nlibrary(rlist)\nlibrary(janitor)\nlibrary(dplyr)\nlibrary(knitr)\n\n# This is a terrible model\nmodel = lmer(mpg ~ cyl * disp + (1|vs), mtcars)\n\n# We save the sjPlot table to an .html file (see the table below)\nsjPlot::tab_model(\n model,\n show.r2 = TRUE,\n show.icc = FALSE,\n show.re.var = FALSE,\n p.style = "scientific",\n emph.p = TRUE,\n file = "Downloads/temp.html")\nRun Code Online (Sandbox Code Playgroud)\n\n现在我们可以读取 .html 文件并对其进行一些清理:
\ntables <- list.clean(readHTMLTable("~/Downloads/temp.html"), fun = is.null, recursive = …Run Code Online (Sandbox Code Playgroud)