R Markdown Footnote in xtable

倖福魔咒の 提交于 2019-12-11 06:43:46

问题


I'm having issues with a footnote not appearing under a table in my R Markdown report. Below is the code I'm using to process which does successfully but with no footnote appearing under the table.

```{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 is a 3x5 matrix of strings. Could someone help me understand why the footnote is not appearing under the table with this current code?


回答1:


add.to.row (and also hline.after) are arguments of the print function, not xtable().

This should get you where you want:

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))



来源:https://stackoverflow.com/questions/44422428/r-markdown-footnote-in-xtable

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!