R生成latex表格代码
2017-09-01 23:57
281 查看
R语言生产latex代码
只需加载程序辑:xtable。代码如下:
# Goal: To make latex tabular out of an R matrix # Setup a nice R object: m <- matrix(rnorm(8), nrow=2) rownames(m) <- c("Age", "Weight") colnames(m) <- c("Person1", "Person2", "Person3", "Person4") m # Translate it into a latex tabular: library(xtable) xtable(m, digits=rep(3,5)) # Production latex code that goes into a paper or a book -- print(xtable(m, caption="String", label="t:"), type="latex", file="blah.gen", table.placement="tp", latex.environments=c("center", "footnotesize")) # Now you do \input{blah.gen} in your latex file. # You're lazy, and want to use R to generate latex tables for you? data <- cbind( c(7,9,11,2), c(2,4,19,21) ) colnames(data) <- c("a","b") rownames(data) <- c("x","y","z","a") xtable(data) # or you could do data <- rbind( c(7,2), c(9,4), c(11,19), c(2,21) ) # and the rest goes through identically.
You can Go Go Go!!!
\input
相关文章推荐
- js+jquery根据json数据生成表格 及 表格和按钮CSS代码
- 用按钮触发Javascript动态生成一个表格的代码
- JS面试题-动态生成表格代码
- 解析表格生成lua代码
- 根据Word表格自动生成SQL数据库脚本的VBScript代码
- 一段动态生成表格的JSP代码讲解
- Jquery 动态生成表格示例代码
- 利用CSS生成精美细线Table表格无需复杂style代码
- jquery 读取页面表格中的数据 生成批量insert代码 并以ajax方式传给后台
- Asp.Net Table控件动态生成表格操作实例(代码调试通过)
- .Net中生成二维的表格的代码 分享
- JavaScript生成带有缩进的表格代码
- .Net中生成二维的表格的代码
- Latex生成并列表格
- java代码生成Excl表格然后以附件的形式进行发送,里面的内容是用数据库的信息进行填充的。
- jquery 生成table表格 部分代码
- jquery 读取页面表格中的数据 生成批量insert代码 并以ajax方式传给后台
- 基于JavaScript代码实现自动生成表格
- 用按钮触发Javascript动态生成一个表格的代码
- iText7根据html表格(table)代码生成表格、解决跨行跨列问题