Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

R Markdown Footnote in xtable

Tags:

r

r-markdown

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?

like image 976
jkeane82 Avatar asked Apr 08 '26 14:04

jkeane82


1 Answers

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

enter image description here

like image 63
GGamba Avatar answered Apr 11 '26 03:04

GGamba



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!