2017-06-07 44 views
0

我遇到的问题未在我的R Markdown报告中的表格下出现。下面是我用来处理哪些代码成功,但没有脚注出现在表下的代码。R在xtable中的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的字符串矩阵。有人能帮我理解为什么脚注不会出现在当前代码的表格下吗?

回答

0

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

+0

哇!这真是愚蠢。它运行后工作。谢谢GGamba! – jkeane82