- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我无法使用 gtsummary 编织成 pdf包裹。这是一个reprex:
library(gtsummary)
reg <- lm(hp ~ cyl, mtcars)
tbl_regression(reg, intercept = TRUE)
intercept = TRUE
时发生争论。如果我删除
intercept
争论,我可以编织成pdf就好了。
output file: reprex.knit.md
! Undefined control sequence.
<argument> ...al \expandafter \let \cmrsideswitch
\@tempa \fi \fi
l.129 (Intercept)
& -51 & -102, -0.03 & 0.050 \\
Error: LaTeX failed to compile reprex.tex. See https://yihui.org/tinytex/r/#debugging for debugging tips. See reprex.log for more info.
Execution halted
sessionInfo()
:
R version 3.6.2 (2019-12-12)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 10 x64 (build 18362)
Matrix products: default
locale:
[1] LC_COLLATE=English_United States.1252 LC_CTYPE=English_United States.1252 LC_MONETARY=English_United States.1252
[4] LC_NUMERIC=C LC_TIME=English_United States.1252
attached base packages:
[1] stats graphics grDevices utils datasets methods base
other attached packages:
[1] gtsummary_1.2.6
loaded via a namespace (and not attached):
[1] Rcpp_1.0.3 pillar_1.4.3 compiler_3.6.2 tools_3.6.2 digest_0.6.24 checkmate_2.0.0 evaluate_0.14
[8] lifecycle_0.1.0 tibble_2.1.3 nlme_3.1-142 gtable_0.3.0 lattice_0.20-38 pkgconfig_2.0.3 rlang_0.4.4
[15] rstudioapi_0.11 commonmark_1.7 yaml_2.2.1 xfun_0.12 dplyr_0.8.4 stringr_1.4.0 knitr_1.28
[22] sass_0.1.2.1 generics_0.0.2 vctrs_0.2.3 grid_3.6.2 tidyselect_1.0.0 glue_1.3.1 R6_2.4.1
[29] rmarkdown_2.1 tidyr_1.0.2 purrr_0.3.3 ggplot2_3.2.1 magrittr_1.5 backports_1.1.5 scales_1.1.0
[36] htmltools_0.4.0 assertthat_0.2.1 gt_0.1.0 colorspace_1.4-1 stringi_1.4.6 lazyeval_0.2.2 munsell_0.5.0
[43] broom_0.5.4 crayon_1.3.4
最佳答案
我能够在我的机器上重新创建错误。 gtsummary 默认使用 gt 包来打印表格。目前,gt 支持 HTML 输出, future 计划使用 LaTeX 和 RTF。虽然您可以为 R markdown 指定 PDF 和 RTF 输出(它通常有效且看起来很棒!),但该功能尚未最终确定。
您还可以使用 {huxtable} 通过 LaTeX 在 R markdown 中从 gtsummary 输出表格。
library(gtsummary)
reg <- lm(hp ~ cyl, mtcars)
tbl_regression(reg, intercept = TRUE) %>%
as_hux_table()
希望这可以帮助!
关于r - 无法使用 r 中的 {gtsummary} 包编织到 pdf,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/60367673/
我在编织我的 RMarkdown 文件时遇到以下错误。 Parser error: while parsing a block mapping at line 1, column 1 did not
有人在 Knitr 中使用 gridSVG 吗?我发现包“gridSVG”提供了一个名为“gridsvg”的设备,我编写的代码如下。 ```{r message=FALSE, echo=FALSE,
在下面的代码片段中,我有一段代码目前正在按我希望的方式运行: def weave_iterable(*iters): return ''.join('{}'.format('{}'*len(c
我有一个相当长的 R 代码,需要大约 2-3 小时才能运行并编织成 HTML。然而,即使出现小错误或警告......编织也会中止......在下面的示例中,由于保存历史错误,它已经这样做了。 proc
我想分享一个关于如何使用github页面在rstudio上在线发布工作的逐步说明。 如果不是来自计算机科学,包括我自己,很多服用Coursera courses on data的人都会有问题,所以我想
我最近开始使用 Sweave * 用于创建使用 R 运行的分析报告,现在我希望对我的 python 脚本做同样的事情。 我找到了对 embedding python in Sweave 的引用docs
我试过在谷歌上搜索来解决这个问题,但有用的解决方案很少。 我已经安装了 Miktex、R 和 R studio。我想使用 Sweave 在 Miktex 中创建 PDF 文档。每次我打开我的 .Rnw
我有一个用 MyEclipse 制作的 Spring MVC 应用程序,其中包含生成的源代码以及我自己的源代码,以及我在生成的类上定义的方面。一切都在 MyEclipse 中编译得很好,但我现在想切换
我正在考虑使用 Postsharp 框架来减轻应用程序方法日志记录的负担。它基本上允许我用日志属性装饰方法,并在编译时将所需的日志代码注入(inject)到 il 中。我喜欢这个解决方案,因为它可以将
docs解释一下,必须通过使用 来启用 LTW xml指令或使用@EnableLoadTimeWeaving注解。然而,我两者都没有做过,但我仍然看到我的项目中的方面是正确编织的! 在这种情况下,我
我正在尝试在运行时加载类,并在此时将它们与一些 AspectJ 方面编织在一起。我启用了加载时织入,当我更常规地使用它时它会起作用。 我的@Aspect 类中有以下内容: @Before("call(
我有一个 .Rmd 文件,以前编织过没有任何问题。现在我在执行此指令时收到以下错误 confusionMatrix(prediction1, ssTesting$classe) 错误是 Error i
我有一个项目 foo-instrumented这取决于 foo . 这个项目实际上仪器foo用额外的代码,并替换它。即,foo是 foo-instrumented 的编译时依赖项但它绝对不是运行时依赖
我有一个项目,它有多个 Maven 模块,其中一个包含我的方面。如何获取方面并编织多个 Maven 模块? AspectJ Maven 插件的文档有点稀疏,找不到很多示例。 我曾尝试将 aspectj
我正在尝试使用 DT::datatable在 R 中输出格式良好的交互式表格。 ...唯一的问题是我想要一份 heroku 工作来为我编写文档,而且我了解到 RStudio 和 rmarkdown::
我正在尝试让 AspectJ 编织在一个简单的 Maven 项目中工作,但不确定哪里出了问题:当我使用“mvn exec:java”运行代码时,我没有看到预期的输出。 我确信代码可以正常工作,因为我在
尝试为大量 DTO 编织默认的 toString() 方法,仅使用编译时编织。目标是使用 Jackson 库返回 JSON 表示。 遵循了 this article 中的建议, 变成了注解式的切面配置
我正在尝试从 RStudio 编织 PDf 文件,但出现以下错误: ! LaTeX Error: File `framed.sty' not found. R 版本:3.2.2 (2015-08-14
kableExtra 创建一个包含一些图表的表格,如 its manual演示。我们将在下表中使用 kableExtra::spec_pointrange() 绘制点范围图,运行本文底部的代码。 但是
假设我在 R 中有代码 not working ,即我运行该代码并得到一些错误和警告,我想通过 R markdown 与第三人共享显示错误和警告的代码和输出. 如果我在 r 代码块中有错误,是否可以编
我是一名优秀的程序员,十分优秀!