2017-06-07 47 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