找回密码
 注册
查看: 326|回复: 0

R语言 sfsmisc包 mat2tex()函数中文帮助文档(中英文对照)

[复制链接]
发表于 2012-9-30 01:38:15 | 显示全部楼层 |阅读模式
mat2tex(sfsmisc)
mat2tex()所属R语言包:sfsmisc

                                        Produce LaTeX commands to print a matrix
                                         LaTeX命令打印一个矩阵

                                         译者:生物统计家园网 机器人LoveR

描述----------Description----------

“Translate” an R matrix (like object) into a LaTeX table, using \begin{tabular} ....
“翻译”R矩阵(例如对象)到一个LaTeX表中,使用\begin{tabular} ...。


用法----------Usage----------


mat2tex(x, file= "mat.tex", nam.center = "l", col.center = "c",
        append = TRUE, digits = 3, title)



参数----------Arguments----------

参数:x
a matrix
矩阵


参数:file
names the file to which LaTeX commands should be written
名LaTeX命令的文件,应书面


参数:nam.center
character specifying row names should be center; default "l".
字符指定行的名称应该是中心,默认"l"。


参数:col.center
character (vector) specifying how the columns should be centered; must have values from c("l","c","r"); defaults to "c".
应集中指定列的字符(矢量),必须到c("l","c","r")"c";默认值。


参数:append
logical; if FALSE, will destroy the file file before writing commands to it; otherwise (by default), simply adds commands at the end of file file.
逻辑,如果FALSE,会破坏文件file命令写入之前,否则(默认情况下),只需添加命令结束时的文件file。


参数:digits
integer; setting of options(digits=..) for purpose of number representation.
整数;设置options(digits=..)为目的的数字表示的。


参数:title
a string, possibly using LaTeX commands, which will span the columns of the LaTeX matrix
一个字符串,可能使用LaTeX命令,这将跨越LaTeX的矩阵的列


值----------Value----------

No value is returned.  This function, when used correctly, only writes LaTeX commands to a file.
无返回值。此功能,在正确使用时,只LaTeX命令写入到文件中。


(作者)----------Author(s)----------


For S: Vincent Carey <a href="mailto:vjcarey@sphunix.sph.jhu.edu">vjcarey@sphunix.sph.jhu.edu</a>, from a
post on Feb.19, 1991 to S-news.  Port to <font face="Courier New,Courier" color="#666666"><b>R</b></font> (and a bit more) by
Martin Maechler <a href="mailto:maechler@stat.math.ethz.ch">maechler@stat.math.ethz.ch</a>.




参见----------See Also----------

latex in package Hmisc is more flexible (but may surprise by its auto-printing ..).
latex在包Hmisc是更灵活的(但可能会让其自动打印..)。


实例----------Examples----------


mex <- matrix(c(pi,pi/2,pi/4,exp(1),exp(2),exp(3)),nrow=2, byrow=TRUE,
               dimnames = list(c("$\\pi$","$e$"),c("a","b","c")))
mat2tex( mex, title="$\\pi, e$, etc." )

## The last command produces the file "mat.tex" containing[#最后的命令产生的文件“mat.tex”包含]

##&gt;  \begin{tabular} {| l|| c| c| c|}[#> \开始{表格} {| L | | C | C | C |}]
##&gt;  \multicolumn{ 4 }{c}{ $\pi, e$, etc. } \\ \hline[> \多列{4} {C} {$ \ PI,E $等} \ \ \ HLINE]
##&gt;     \  &amp; a &amp; b &amp; c \\ \hline \hline[#> \&A&B&C \ \ \ HLINE \ HLINE]
##&gt;  $\pi$ &amp; 3.14 &amp; 1.57 &amp; 0.785 \\ \hline[#$ \ PI $&3.14&1.57&0.785 \ \ \ HLINE]
##&gt;  $e$ &amp; 2.72 &amp; 7.39 &amp; 20.1 \\ \hline[#$ E $&2.72&7.39&20.1 \ \ \ HLINE]
##&gt;  \end{tabular}[#> \ {表格}]

## Now you have to properly embed the contents of this file[#现在,你必须正确地嵌入到这个文件的内容]
## in a LaTeX document -- for example, you will need a[在LaTeX文档 - 例如,你将需要一个]
## preamble, the \begin{document} statement, etc.[#序言中,在\ begin {}语句,等等。]

## Note that the backslash needs protection in dimnames[#需要注意的是反斜杠需要在dimnames保护]
## or title actions.[#标题行动。]

mat2tex(mex, stdout(), col.center = c("r","r","c"))

转载请注明:出自 生物统计家园网(http://www.biostatistic.net)。


注:
注1:为了方便大家学习,本文档为生物统计家园网机器人LoveR翻译而成,仅供个人R语言学习参考使用,生物统计家园保留版权。
注2:由于是机器人自动翻译,难免有不准确之处,使用时仔细对照中、英文内容进行反复理解,可以帮助R语言的学习。
注3:如遇到不准确之处,请在本贴的后面进行回帖,我们会逐渐进行修订。
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

手机版|小黑屋|生物统计家园 网站价格

GMT+8, 2025-5-21 05:27 , Processed in 0.026807 second(s), 16 queries .

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表