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

R语言:Quotes()函数中文帮助文档(中英文对照)

[复制链接]
发表于 2012-2-16 18:41:19 | 显示全部楼层 |阅读模式
Quotes(base)
Quotes()所属R语言包:base

                                        Quotes
                                         引号

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

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

Descriptions of the various uses of quoting in R.
R中引用的各种用途的说明


Details

详情----------Details----------

Three types of quotes are part of the syntax of R: single and double quotation marks and the backtick (or back quote, `).  In addition, backslash is used to escape the following character inside character constants.
三种类型的引号是R语法:单引号和双引号和反引号(或报价,)的一部分。此外,使用反斜杠字符常量内逃脱下列字符。


字符常量----------Character constants----------

Single and double quotes delimit character constants.  They can be used interchangeably but double quotes are preferred (and character constants are printed using double quotes), so single quotes are normally only used to delimit character constants containing double quotes.
单引号和双引号分隔的字符常量。他们可以互换使用,但双引号是首选(使用双引号字符常量打印),所以单引号通常只用于分隔包含双引号的字符常量。

Backslash is used to start an escape sequence inside character constants.  Escaping a character not in the following table is an error.
反斜杠是用来启动一个转义序列字符常量内。转义字符,而不是在下面的表是一个错误。

Single quotes need to be escaped by backslash in single-quoted strings, and double quotes in double-quoted strings.
要通过反斜杠转义单引号,双引号和双引号的字符串单引号需要。


参数:\n
newline
换行符


参数:\r
carriage return
回车


参数:\t
tab
“标签


参数:\b
backspace
退格


参数:\a
alert (bell)
警报(钟)


参数:\f
form feed
形成饲料


参数:\v
vertical tab
垂直制表符


参数:\\
backslash \
反斜杠\


参数:\'
ASCII apostrophe '
ASCII码撇'


参数:\"
ASCII quotation mark "
ASCII码引号"


参数:\nnn
character with given octal code (1, 2 or 3 digits)
字符的八进制代码(1,2或3位数字)


参数:\xnn
character with given hex code (1 or 2 hex digits)
字符的十六进制代码(十六进制数字1或2)


参数:\unnnn
Unicode character with given code (1--4 hex digits)
Unicode字符与代码(1  -  4个十六进制数字)


参数:\Unnnnnnnn
Unicode character with given code (1--8 hex digits)
Unicode字符与代码(1  -  8个十六进制数字)

Alternative forms for the last two are \u{nnnn} and \U{nnnnnnnn}.  All except the Unicode escape sequences are also supported when reading character strings by scan and read.table if allowEscapes = TRUE.  Unicode escapes can be used to enter Unicode characters not in the current locale's charset (when the string will be stored internally in UTF-8).
在过去两年的替代形式是\u{nnnn}和\U{nnnnnnnn}。除了Unicode转义序列还支持阅读时字符串scan和read.table如果allowEscapes = TRUE。可以使用Unicode转义输入Unicode字符在当前语言环境的字符集(字符串时,将内部储存在UTF-8)。

The parser does not allow the use of both octal/hex and Unicode escapes in a single string.
解析器不允许使用八进制/十六进制和Unicode转义在一个单一的字符串。

These forms will also be used by print.default when outputting non-printable characters (including backslash).
这些形式也可以使用print.default当输出非打印字符(包括反斜杠)。

Embedded nuls are not allowed in character strings, so using escapes (such as \0) for a nul will result in the string being truncated at that point (usually with a warning).
嵌入式nuls是不允许字符串,所以使用转义(如\0)为一个NUL会导致字符串被截断在这一点上(通常是一个警告)。


名称和标识符----------Names and Identifiers----------

Identifiers consist of a sequence of letters, digits, the period (.) and the underscore.  They must not start with a digit nor underscore, nor with a period followed by a digit.  Reserved words are not valid identifiers.
标识符由字母,数字,期间(.)和下划线的序列。他们绝不能以数字开头,也不强调,也不后跟数字的时期。保留字是不合法的标识符。

The definition of a letter depends on the current locale, but only ASCII digits are considered to be digits.
一个字母的定义依赖于当前的语言环境,但只有ASCII数字被认为是数字。

Such identifiers are also known as syntactic names and may be used directly in R code.  Almost always, other names can be used provided they are quoted.  The preferred quote is the backtick (`), and deparse will normally use it, but under many circumstances single or double quotes can be used (as a character constant will often be converted to a name).  One place where backticks may be essential is to delimit variable names in formulae: see formula.
这样的标识符,也称为语法名称,可用于直接在R代码。几乎总是,其他的名字,可以用来提供他们均以。首选的报价是反引号(),deparse通常会使用它,但在很多情况下,可用于单或双引号(字符常量往往会被转换到一个名字)。其中反引号可能是至关重要的一个地方是划定公式中的变量名:看到formula。


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

Syntax for other aspects of the syntax.
Syntax语法等方面。

sQuote for quoting English text.
sQuote引述英文文本。

shQuote for quoting OS commands.
shQuote援引OS命令。

The R Language Definition manual.
R语言定义手册。

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


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

使用道具 举报

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

本版积分规则

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

GMT+8, 2025-1-23 21:21 , Processed in 0.025875 second(s), 15 queries .

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

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