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

R语言 xtable包 print.xtable()函数中文帮助文档(中英文对照)

[复制链接]
发表于 2012-10-2 07:23:32 | 显示全部楼层 |阅读模式
print.xtable(xtable)
print.xtable()所属R语言包:xtable

                                        Print Export Tables
                                         打印导出表

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

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

Function returning and displaying or writing to disk the LaTeX or HTML code associated with the supplied object of class xtable.
函数返回和显示或写入到磁盘上的乳胶或HTML代码与所提供的对象的类xtable。


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


## S3 method for class 'xtable'
print(x,
  type=getOption("xtable.type", "latex"),
  file=getOption("xtable.file", ""),
  append=getOption("xtable.append", FALSE),
  floating=getOption("xtable.floating", TRUE),
  floating.environment=getOption("xtable.floating.environment", "table"),
  table.placement=getOption("xtable.table.placement", "ht"),
  caption.placement=getOption("xtable.caption.placement", "bottom"),
  latex.environments=getOption("xtable.latex.environments", c("center")),
  tabular.environment=getOption("xtable.tabular.environment", "tabular"),
  size=getOption("xtable.size", NULL),
  hline.after=getOption("xtable.hline.after", c(-1,0,nrow(x))),
  NA.string=getOption("xtable.NA.string", ""),
  include.rownames=getOption("xtable.include.rownames", TRUE),
  include.colnames=getOption("xtable.include.colnames", TRUE),
  only.contents=getOption("xtable.only.contents", FALSE),
  add.to.row=getOption("xtable.add.to.row", NULL),
  sanitize.text.function=getOption("xtable.sanitize.text.function", NULL),
  sanitize.rownames.function=getOption("xtable.sanitize.rownames.function",
    sanitize.text.function),
  sanitize.colnames.function=getOption("xtable.sanitize.colnames.function",
    sanitize.text.function),
  math.style.negative=getOption("xtable.math.style.negative", FALSE),
  html.table.attributes=getOption("xtable.html.table.attributes", "border=1"),
  print.results=getOption("xtable.print.results", TRUE),
  format.args=getOption("xtable.format.args", NULL),
  rotate.rownames=getOption("xtable.rotate.rownames", FALSE),
  rotate.colnames=getOption("xtable.rotate.colnames", FALSE),
  booktabs = getOption("xtable.booktabs", FALSE),
  scalebox = getOption("xtable.scalebox", NULL),
  width = getOption("xtable.width", NULL),



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

参数:x
An object of class "xtable".
对象的类"xtable"。


参数:type
Type of table to produce.  Possible values for type are "latex" or "html". Default value is "latex".
表产生的类型。可能的值type是"latex"或"html"。默认值为"latex"。


参数:file
Name of file where the resulting code should be saved.  If file="", output is displayed on screen.  Note that the function also (invisibly) returns a character vector of the results (which can be helpful for post-processing). Default value is "".
生成的代码应该保存的文件的名称。如果file="",输出显示在屏幕上。需要注意的是功能(不可见)的结果(这可以帮助进行后处理)返回一个字符向量。默认值为""。


参数:append
If TRUE and file!="", code will be appended to file instead of overwriting file. Default value is FALSE.
如果TRUE和file!="",代码将被追加,而不是覆盖file到file。默认值为FALSE。


参数:floating
If TRUE and type="latex", the resulting table will be a floating table (using, for example, \begin{table} and \end{table}).  See floating.environment below. Default value is TRUE.
如果TRUE和type="latex",结果表将是一个浮动的表(使用,例如,\begin{table}和\end{table})。见floating.environment下面。默认值为TRUE。


参数:floating.environment
If floating=TRUE and type="latex", the resulting table uses the specified floating environment. Possible values are "table", "table*", or "sidewaystable" (defined in the LaTeX package 'rotating'). Default value is "table".
如果floating=TRUE和type="latex",所得到的表使用指定浮点环境。可能的值有"table","table*"或"sidewaystable"(定义在LaTeX的包旋转)。默认值为"table"。


参数:table.placement
If floating=TRUE and type="latex", the floating table will have placement given by table.placement where table.placement must be NULL or contain only elements of {"h","t","b","p","!","H"}. Default value is "ht".
如果floating=TRUE和type="latex",浮动表将放置由table.placementtable.placement是NULL或仅包含元素的“H”, “t”的中,“b”,“p”的,“!”,“H”}。默认值为"ht"。


参数:caption.placement
The caption will be have placed at the bottom of the table if caption.placement is "bottom" and at the top of the table if it equals "top". Default value is "bottom".
的标题将被放置在底部的表caption.placement如果是"bottom"和顶部的表,如果它等于"top"。默认值为"bottom"。


参数:latex.environments
If floating=TRUE and type="latex", the specificed latex environments (provided as a character vector) will enclose the tabuluar environment. Default value is "center".
如果floating=TRUE和type="latex"“中的指定乳胶的环境中(作为一个字符向量)会附上tabuluar的环境。默认值为"center"。


参数:tabular.environment
When type="latex", the tabular environment that will be used. Defaults to "tabular". When working with tables that extend more than one page, using tabular.environment="longtable" and the LaTeX package "longtable" (see Fairbairns, 2005) allows one to typeset them uniformly. Note that "floating"  should be set to "FALSE" when using the "longtable" environment.
当type="latex",片状,将用于环境。默认为"tabular"的。当工作表,扩展多个页面,使用tabular.environment="longtable"和LaTeX的包"longtable"(见Fairbairns,2005),允许一到排版,它们均匀。注意"floating"应设置为"FALSE"使用时"longtable"环境。


参数:size
An arbitrary character vector intended to be used to set the font size in a LaTeX table.  The supplied value (if not NULL) is inserted just before the tabular environment starts. Default value is NULL.
任意一个字符向量拟用于设置一个LaTeX表中的字体大小。提供的值(如果不是NULL)之前被插入的表格的环境开始。默认值为NULL。


参数:hline.after
When type="latex", a vector of numbers between -1 and "nrow(x)", inclusive, indicating the rows after which a horizontal line should appear.  If NULL is used no lines are produced. Default value is c(-1,0,nrow(x)) which means draw a line before and after the columns names and at the end of the table. Repeated values are allowed.
当type="latex",一个向量介于-1和"nrow(x)",包容性,这表明一个水平线上行之后,应该出现的数字。如果NULL使用无线生产。默认值是c(-1,0,nrow(x))这意味着画一条线之前和之后的列名称和表的末尾。重复值是允许的。


参数:NA.string
String to be used for missing values in table entries.  Default value is "".
字符串可以用于缺少的表条目中的值。默认值为""。


参数:include.rownames
logical. If TRUE the rows names is printed. Default value is TRUE.
逻辑。如果印刷TRUE行名称。默认值为TRUE。


参数:include.colnames
logical. If TRUE the columns names is printed. Default value is TRUE.
逻辑。如果打印TRUE的列名。默认值为TRUE。


参数:only.contents
logical. If TRUE only the rows of the table is printed. Default value is FALSE.
逻辑。如果TRUE行的表打印。默认值为FALSE。


参数:add.to.row
a list of two components. The first component (which should be called 'pos') is a list contains the position of rows on which extra commands should be added at the end, The second component (which should be called 'command') is a character vector of the same length of the first component which contains the command that should be added at the end of the specified rows. Default value is NULL, i.e. do not add commands.
两部分组成的列表。第一部分(这应该被称为“POS”)是一个列表包含应在末尾添加额外的命令行的位置,第二个组成部分(这应该被称为命令)是相同的字符向量长度的第一组分,其中包含的命令,应加在指定的行的结束。默认值是NULL,即不添加命令。


参数:sanitize.text.function
All non-numeric enteries (except row and column names) are sanitised in an attempt to remove characters which have special meaning for the output format. If sanitize.text.function is not NULL (the default), it should be a function taking a character vector and returning one, and will be used for the sanitization instead of the default internal function.
所有非数字enteries的(除了行和列名)消毒,试图删除它们有特殊意义的输出格式的字符。 sanitize.text.function如果不为NULL(默认值),它应该是一个字符向量和函数返回一个,将用于“过冷河”,而不是默认的内部功能。


参数:sanitize.rownames.function
Like the sanitize.text.function, but applicable to row names.  The default uses the sanitize.text.function.
像sanitize.text.function,但适用于行名称。默认情况下使用sanitize.text.function。


参数:sanitize.colnames.function
Like the sanitize.text.function, but applicable to column names.  The default uses the sanitize.text.function.
像sanitize.text.function,但适用于列名。默认情况下使用sanitize.text.function。


参数:math.style.negative
In a LaTeX table, if TRUE, then use $-$ for the negative sign (as was the behavior prior to version 1.5-3).  Default value is FALSE.
中一个LaTeX的表,如果TRUE,然后用负号$  -  $(的行为之前的版本1.5-3)。默认值为FALSE。


参数:html.table.attributes
In an HTML table, attributes associated with the <TABLE> tag.  Default value is border=1.
在一个HTML表格中,属性与<TABLE>标签。默认值为border=1。


参数:print.results
If TRUE, the generated table is printed to standard output.  Set this to FALSE if you will just be using the character vector that is returned invisibly.
如果TRUE,所生成的表被打印到标准输出。设置为FALSE如果你只是使用的字符不可见的,则返回的向量。


参数:format.args
List of arguments for the formatC function.  For example, standard German number separators can be specified as format.args=list(big.mark = "'", decimal.mark = ",")).
为formatC函数的参数列表。例如,标准的德国数字分隔符可以被指定为format.args=list(big.mark = "'", decimal.mark = ","))。


参数:rotate.rownames
If TRUE, the row names are displayed vertically in LaTeX.
如果TRUE,行名称会显示在LaTeX垂直。


参数:rotate.colnames
If TRUE, the column names are displayed vertically in LaTeX.
如果TRUE,列名垂直显示在LaTeX。


参数:booktabs
If TRUE, the toprule, midrule and bottomrule tags from the LaTex "booktabs" package are used rather than hline for the horizontal line tags.
如果TRUE,toprule,midrule和bottomrule标签的的乳胶“booktabs”包的使用,而不是hline水平线标签。


参数:scalebox
If not NULL, a scalebox clause will be added around the tabular environment with the specified value used as the scaling factor.
如果不是NULL,一个scalebox条款将被添加指定的值作为比例因子与周围环境的表格。


参数:width
If not NULL, the specified value is included in parenthesis between the tabular environment begin tag and the alignment specification.  This allows specification of the table width when using tabular environments such as tabular* and tabularx.  Note that table width specification is not supported with the tabular or longtable environments.
如果没有NULL,指定的值包含在括号之间的板状环境begin标记和对准规范。这允许指定表格的宽度,时使用表格环境中,如tabular*和tabularx。请注意,表格的宽度不规范的与tabular或longtable环境的支持。


参数:...
Additional arguments.  (Currently ignored.)
其他参数。 (目前忽略不计。)


Details

详细信息----------Details----------

This function displays or writes to disk the code to produce a table associated with an object x of class "xtable". The resulting code is either a LaTeX or HTML table, depending on the value of type.  The function also (invisibly) returns a character vector of the results (which can be helpful for post-processing).
此功能可以显示或写入到磁盘的代码表与对象x类"xtable"。所产生的程式码是乳胶或HTML的表格,根据的价值type。功能(不可见)返回的结果(这可以帮助进行后处理)字符向量。

Since version 1.4 the non default behavior of hline.after is changed. To obtain the same results as the previous versions add to the hline.after vector the vector c(-1, 0, nrow(x)) where nrow(x) is the numbers of rows of the object.
由于1.4版的hline.after非默认行为的改变。要获得同样的结果,以前的版本添加到hline.after矢量矢量c(-1, 0, nrow(x))其中nrow(x)是的对象的行数。

From version 1.4-3, all non-numeric columns are sanitized, and all LaTeX special characters are sanitised for LaTeX output.  See Section 3 of the xtableGallery vignette for an example of customising the sanitization. From version 1.4-4, the sanitization also applies to column names.  To remove any text sanitization, specify sanitize.text.function=function(x){x}.
从1.4-3版本,所有非数字列消毒,所有的LaTeX的特殊字符消毒LaTeX输出。请参阅第3 xtableGallery小插曲,例如自定义的消毒。从1.4-4版本,的消毒也适用于列名。要删除任何文本消毒,指定sanitize.text.function=function(x){x}。

From version 1.6-1 the default values for the arguments other than x are obtainined using getOption().  Hence the user can set the values once with options() rather than setting them in every call to print.xtable().
从1.6-1版本的默认值的参数以外x的使用getOption()obtainined。因此,用户可以设置的值一次,options(),而不是将它们设置在每次调用print.xtable()。


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


David Dahl <a href="mailto:dahl@stat.tamu.edu">dahl@stat.tamu.edu</a> with contributions and suggestions from many others (see source code).



参考文献----------References----------



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

xtable, caption, label,
xtable,caption,label,

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


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

使用道具 举报

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

本版积分规则

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

GMT+8, 2024-11-24 08:29 , Processed in 0.030441 second(s), 15 queries .

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

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