r - 如何在 R 中的 Hmisc 中将注释附加到 latex 表?

标签 r latex hmisc

一种不优雅的方法是在注释文本中添加 tex 代码行。

但是在 latex 中是否有更原生的做笔记的方式? Hmisc 的功能R中的包?

最佳答案

有一种方法不是在 Hmisc 中而是使用 starpolishr包裹,

install.packages("devtools")
library(devtools)
install_github("ChandlerLutz/starpolishr");library(starpolishr)

插入带有标题包的脚注
la<-latex(mtcars[1:2,1:5],file="example.tex",caption = "table using caption",
    where="!htbp") 
file0<-readLines("example.tex") 
file0<-star_notes_tex(file0, note = "file using caption*") 
cat(file0, file = paste0(getwd(),"/file0.tex"),sep="\n")

用三部分表插入脚注

注意,你必须在 Hmisc::latex 中使用 caption 和 label 参数
mt <- mtcars[1:2,1:5]
mt[1,1]<-paste0(mt[1,1],"\\tnote{*}")
la<-latex(mt,file="example1.tex",label=" ",caption="table using threeparttable",
    where="!htbp") 
file1<-readLines("example1.tex") 
file1<-star_notes_tex(file1, note.type = "threeparttable",
note = "* notes with threeparttable : For this example you must use both label and caption, the
 threepartable code is meant to be used with tables generated by
 stargazer where a row with label is present. Otherwise the threepart table 
 argument is badly positionned.")
cat(file1, file = paste0(getwd(),"/file1.tex"),sep="\n")

footnotes

关于r - 如何在 R 中的 Hmisc 中将注释附加到 latex 表?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20674065/

相关文章:

algorithm - 在 LaTeX 算法环境中格式化注释

r - R 中变量组的均值和置信区间

r - 如何根据权重复制观察结果

python - 在 %R 神奇单元格中显示多个绘图

r - 渲染多个 Rmarkdown 报告时出现 Pandoc 错误 1033

r - 分组相关矩阵

r - 使用 Hmisc 包 (R) 生成类似输出的 proc 报告 (SAS)?

r - 使用 switch 从 ggplot2 函数中转换变量

latex - 如何将我的部分编号保留在Latex中,而只是将其隐藏?

Python Pweave 到 LaTeX