我想使用 kable 打印 stargazer 表。
当我在 markdown 中运行代码时,我得到了 stargazer 表,但|
在表之前的这些行之间有多行带有符号。
我还在开始时收到一条警告消息:
Warning in kable_markdown(x = structure(c("", "<table style=\"text-
align:center\"><caption><strong>Crude models: OR for mRS at discharge >3
with 95% CI</strong></caption>", : The table should have a header (column
names)
我的输出如下所示:
这是我的表格代码(有一些更改):
mod.example1 <- glm(bad_outcome~x1+x2+x3+x4, family = "binomial", data = dat0)
mod.example2 <- glm(bad_outcome~x1+x2+x3+x4, family = "binomial", data = dat1)
CI.list <- list(exp(confint(mod.example1)),exp(confint(mod.example2)))
my.stg <- stargazer(
title = "my models: OR for bad outcome",
mod.example1
mod.example2,
type="html",
digits = 2,
t.auto = FALSE,
model.numbers = F,
keep.stat = "n",
report = c("vc*sp"),
omit = "Constant",
star.cutoffs = c(0.05,0.01,0.001),
no.space = FALSE,
single.row = F,
dep.var.labels = c("***bad outcome***"),
covariate.labels = c("x1","x2","x3","x4"),
column.labels = c("-**dat0**-", "-**dat1**-"),
ci= T,
ci.custom = CI.list,
apply.coef=exp)
在一个新的块中:
kable(my.stg)
表格被打印但仅在多行/矩形之后。我还从其他计算机上运行了代码,然后问题没有发生。什么可能导致这种情况?