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

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

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

                                        Assignment Operators
                                         赋值运算符

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

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

Assign a value to a name.
指定名称的值。


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


x <- value
x <<- value
value -> x
value ->> x

x = value



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

参数:x
a variable name (possibly quoted).
一个变量的名称(可能引用)。


参数:value
a value to be assigned to x.
一个值被分配到x。


Details

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

There are three different assignment operators: two of them have leftwards and rightwards forms.
有三种不同的赋值运算符:他们两个有向左和向右的形式。

The operators <- and = assign into the environment in which they are evaluated.  The  operator <- can be used anywhere, whereas the operator = is only allowed at the top level (e.g., in the complete expression typed at the command prompt) or as one of the subexpressions in a braced list of expressions.
运营商<-和=分配到它们评估的环境。 <-操作可以在任何地方使用,而运营商=只允许在顶层(例如,在命令提示符下键入完整的表达),或作为支撑名单在子表达式之一表达式。

The operators <<- and ->> cause a search to made through the environment for an existing definition of the variable being assigned.  If such a variable is found (and its binding is not locked) then its value is redefined, otherwise assignment takes place in the global environment.  Note that their semantics differ from that in the S language, but are useful in conjunction with the scoping rules of R.  See "The R Language Definition" manual for further details and examples.
运营商<<-和->>导致搜索通过对现有定义的环境变量被分配。如果发现这样一个变量(和其约束力不锁定),然后它的价值被重新定义,否则转让需要在全球环境中的地方。请注意,他们的语义不同于在S语言,但与R的作用域规则见“R语言定义的手册作进一步的细节和例子结合非常有用。

In all the assignment operator expressions, x can be a name or an expression defining a part of an object to be replaced (e.g., z[[1]]).  A syntactic name does not need to be quoted, though it can be (preferably by backticks).
在所有的赋值运算符的表达式,x可以是一个名称或表达式定义一个对象被替换的部分(例如,z[[1]])。语法名称不需要被引用,但它可以(最好由反引号)。

The leftwards forms of assignment <- = <<- group right to left, the other from left to right.
转让的形式向左<- = <<-组从右到左,从左至右。


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

value.  Thus one can use a <- b <- c <- 6.
value。因此,可以使用a <- b <- c <- 6。


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

The New S Language. Wadsworth &amp; Brooks/Cole.
Programming with Data.  A Guide to the S Language. Springer (for <code>=</code>).

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

assign, for &ldquo;subassignment&rdquo; such as x[i] <- v, [<-;  environment.
assign,“subassignment”如x[i] <- v,[<-;environment的。

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


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

使用道具 举报

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

本版积分规则

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

GMT+8, 2025-2-2 16:50 , Processed in 0.032576 second(s), 15 queries .

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

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