deparse(base)
deparse()所属R语言包:base
Expression Deparsing
表达Deparsing
译者:生物统计家园网 机器人LoveR
描述----------Description----------
Turn unevaluated expressions into character strings.
变成不计算表达式字符串。
用法----------Usage----------
deparse(expr, width.cutoff = 60L,
backtick = mode(expr) %in%
c("call", "expression", "(", "function"),
control = c("keepInteger", "showAttributes", "keepNA"),
nlines = -1L)
参数----------Arguments----------
参数:expr
any R expression.
任何R的表达。
参数:width.cutoff
integer in [20, 500] determining the cutoff (in bytes) at which line-breaking is tried.
整数[20, 500]确定截止(以字节为单位),在换行尝试。
参数:backtick
logical indicating whether symbolic names should be enclosed in backticks if they do not follow the standard syntax.
逻辑指示符号名称是否应在反引号,如果他们不按照标准的语法。
参数:control
character vector of deparsing options. See .deparseOpts.
字符向量deparsing期权。看到.deparseOpts。
参数:nlines
integer: the maximum number of lines to produce. Negative values indicate no limit.
整数:产生的最大行数。负值表示没有限制。
Details
详情----------Details----------
This function turns unevaluated expressions (where "expression" is taken in a wider sense than the strict concept of a vector of mode "expression" used in expression) into character strings (a kind of inverse to parse).
此功能将不计算表达式(“表达”,采取较严格的模式向量的概念,在更广泛的意义上"expression"expression)成字符串(逆parse)。
A typical use of this is to create informative labels for data sets and plots. The example shows a simple use of this facility. It uses the functions deparse and substitute to create labels for a plot which are character string versions of the actual arguments to the function myplot.
一个典型的用途是创建数据集和绘图信息标签。这个例子显示了这个设施使用简单。它使用的功能deparse和substitute标签创建一个图,这是实际参数的字符串版本的功能myplot。
The default for the backtick option is not to quote single symbols but only composite expressions. This is a compromise to avoid breaking existing code.
backtick选项默认是不报价单的符号,但唯一的复合表达式。这是一种妥协,以避免破坏现有的代码。
Using control = "all" comes closest to making deparse() an inverse of parse(). However, not all objects are deparse-able even with this option and a warning will be issued if the function recognizes that it is being asked to do the impossible.
使用control = "all"最接近使deparse()parse()的逆。然而,并不是所有的对象都可以deparse与此选项和功能的认识,它被要求做不可能会发出一个警告。
Numeric and complex vectors are converted using 15 significant digits: see as.character for more details.
数字和复杂的向量转换使用15个有效数字:看到as.character更多细节。
width.cutoff is a lower bound for the line lengths: deparsing a line proceeds until at least width.cutoff bytes have been output and e.g. arg = value expressions will not be split across lines.
width.cutoff是一个较低的线长度的约束:deparsing行收益,直到至少width.cutoff字节已经输出和如arg = value表达式将不会被拆分为多行。
注意----------Note----------
To avoid the risk of a source attribute out of sync with the actual function definition, the source attribute of a function will never be deparsed as an attribute.
为了避免风险源属性的同步与实际的函数定义,函数的源属性将永远不会被deparsed作为一个属性。
参考文献----------References----------
The New S Language. Wadsworth & Brooks/Cole.
参见----------See Also----------
substitute, parse, expression.
substitute,parse,expression。
Quotes for quoting conventions, including backticks.
Quotes援引公约,其中包括反引号。
举例----------Examples----------
require(stats); require(graphics)
deparse(args(lm))
deparse(args(lm), width = 500)
myplot <-
function(x, y) {
plot(x, y, xlab=deparse(substitute(x)),
ylab=deparse(substitute(y)))
}
e <- quote(`foo bar`)
deparse(e)
deparse(e, backtick=TRUE)
e <- quote(`foo bar`+1)
deparse(e)
deparse(e, control = "all")
转载请注明:出自 生物统计家园网(http://www.biostatistic.net)。
注:
注1:为了方便大家学习,本文档为生物统计家园网机器人LoveR翻译而成,仅供个人R语言学习参考使用,生物统计家园保留版权。
注2:由于是机器人自动翻译,难免有不准确之处,使用时仔细对照中、英文内容进行反复理解,可以帮助R语言的学习。
注3:如遇到不准确之处,请在本贴的后面进行回帖,我们会逐渐进行修订。
|