如何在Latex的表格顶部添加标题?

时间:2019-05-05 23:05:00

标签: r latex

我正在尝试在表格顶部添加标题,并附上表格编号和名称。我已经尝试将caption ='TEST'与caption.placement ='TOP'

<<include=F>>=
rown <- c(
'Coefficient'
, 'SAT Comp'
, 'Incoming GPA'
, 'Incoming Units'
)
df <- cbind(
rown
, as.data.frame(store1$coefficients)
)
coln <- paste(
""
, "Estimate"
, "Std. Error"
, "$t$-Stat"
, "$p$-Value"
, sep = " & "
)
hline <- c(0)
htype <- c(
paste0(paste0(coln, "\\\\"), "\n")
)
cap <- 'TEST'
x_df <- xtable(df)
@

<<include=T, echo=F, results='asis'>>=
print.xtable(x_df
, caption = 'TEST'
, caption.placement = 'top'
 , add.to.row = list(
pos = as.list(hline)
, command = htype
  )
  , include.colnames = F
, include.rownames = F
, sanitize.text.function = function(x){x}
, sanitize.colnames.function = function(x){x}
, sanitize.rownames.function = function(x){x}
)
@

我编译时标题根本没有出现。

0 个答案:

没有答案
相关问题