在xtable中的Markdown脚注

时间:2017-06-07 20:44:16

标签: r r-markdown

我的R Markdown报告中的脚注没有出现在桌子下面。以下是我用来处理的代码,该代码成功但没有脚注出现在表格下面。

```{r ccxtable7, results="asis", echo=FALSE}
comment <- list(pos = list(0), command = NULL)
comment$pos[[1]] <- c(nrow(indPctChgCC))
comment$command <- c(paste("\\hline\n",
                          "{\\footnotesize Note: * signifies number of 
properties used was 35 or less.}\n", sep = ""))

print(xtable(valPctCon(indPctChgCC, indfreqCC, 35), align = "crrrrr", 
             label = "tab:indCC", add.to.row = comment, hline.after = c(-1,0),
caption = "Industrial Certified-Certified Percentage Change per Value Segment"))
```

indPctChCC是一个3x5的字符串矩阵。有人可以帮助我理解为什么脚注没有出现在当前代码的表格下面吗?

1 个答案:

答案 0 :(得分:1)

add.to.row(以及hline.after)是print函数的参数,而不是xtable()

这可以让你到达你想要的地方:

print(xtable(tab, align = "crrr", 
             label = "tab:indCC",
             caption = "Industrial Certified-Certified Percentage Change per Value Segment"), 
      add.to.row = comment, 
      hline.after = c(-1,0))

enter image description here

相关问题