Colon(base)
Colon()所属R语言包:base
Colon Operator
冒号运算符
译者:生物统计家园网 机器人LoveR
描述----------Description----------
Generate regular sequences.
生成正则序列。
用法----------Usage----------
from:to
a:b
参数----------Arguments----------
参数:from
starting value of sequence.
序列的起始值。
参数:to
(maximal) end value of the sequence.
(最大)序列的末尾值。
参数:a, b
factors of the same length.
factors的长度相同。
Details
详情----------Details----------
The binary operator : has two meanings: for factors a:b is equivalent to interaction(a, b) (but the levels are ordered and labelled differently).
二元运算符:有两层含义:为因素a:b相当于interaction(a, b)(但水平排序和标记的不同)。
For other arguments from:to is equivalent to seq(from, to), and generates a sequence from from to to in steps of 1 or -1. Value to will be included if it differs from from by an integer up to a numeric fuzz of about 1e-7. Non-numeric arguments are coerced internally (hence without dispatching methods) to numeric—complex values will have their imaginary parts discarded with a warning.
对于其他参数from:to是相当于seq(from, to),并从fromto在1或-1的步骤生成一个序列。值to将包括如果它不同于from整数到1e-7的数字模糊。非数字的参数强制(因此没有调度方法)内部数字复杂值将有一个警告丢弃其虚部。
值----------Value----------
For numeric arguments, a numeric vector. This will be of type integer if from is integer-valued and the result is representable in the R integer type, otherwise of type "double" (aka mode "numeric").
对于数字参数,数字向量。这将是类型integer如果from是整型值,其结果是在R整数类型的表示,否则类型,"double"(又名mode"numeric" )。
For factors, an unordered factor with levels labelled as la:lb and ordered lexicographically (that is, lb varies fastest).
因素,无序的标记la:lb水平的因素,并按字典顺序排序(也就是说,lb变化最快)。
参考文献----------References----------
The New S Language. Wadsworth & Brooks/Cole.<br> (for numeric arguments: S does not have <code>:</code> for factors.)
参见----------See Also----------
seq (a generalization of from:to).
seq(from:to的泛化)。“
As an alternative to using : for factors, interaction.
作为替代使用:因素,interaction。
For : used in the formal representation of an interaction, see formula.
:在一个互动的正式代表,看到formula。
举例----------Examples----------
1:4
pi:6 # real[实]
6:pi # integer[整数]
f1 <- gl(2,3); f1
f2 <- gl(3,2); f2
f1:f2 # a factor, the "cross" f1 x f2[一个因素,“叉乘”F1 x F2]
转载请注明:出自 生物统计家园网(http://www.biostatistic.net)。
注:
注1:为了方便大家学习,本文档为生物统计家园网机器人LoveR翻译而成,仅供个人R语言学习参考使用,生物统计家园保留版权。
注2:由于是机器人自动翻译,难免有不准确之处,使用时仔细对照中、英文内容进行反复理解,可以帮助R语言的学习。
注3:如遇到不准确之处,请在本贴的后面进行回帖,我们会逐渐进行修订。
|