XIntegerViews-class(IRanges)
XIntegerViews-class()所属R语言包:IRanges
The XIntegerViews class
XIntegerViews类
译者:生物统计家园网 机器人LoveR
描述----------Description----------
The XIntegerViews class is the basic container for storing a set of views (start/end locations) on the same XInteger object.
XIntegerViews类是存放一组上相同XInteger对象的意见(开始/结束位置)的基本容器。
Details
详情----------Details----------
An XIntegerViews object contains a set of views (start/end locations) on the same XInteger object called "the subject integer vector" or simply "the subject". Each view is defined by its start and end locations: both are integers such that start <= end. An XIntegerViews object is in fact a particular case of a Views object (the XIntegerViews class contains the Views class) so it can be manipulated in a similar manner: see ?Views for more information. Note that two views can overlap and that a view can be "out of limits" i.e. it can start before the first element of the subject or/and end after its last element.
一个XIntegerViews对象包含的意见,被称为“受整数向量”或干脆“的主题是”在同一XInteger对象(开始/结束位置)。每个视图定义其开始和结束的位置:两者都是整数,这样启动<=结束。对象是一个XIntegerViews实际上是一个视图对象(在XIntegerViews类包含视图类)的特殊情况,因此它可以以类似的方式操作:见?Views更多信息。注意两方面的意见,可以重叠和视图可以是“出”,即它可以启动的主题和/或结束前的最后一个元素之后的第一个元素的限制。
其他方法----------Other methods----------
In the code snippets below, x, object, e1 and e2 are XIntegerViews objects, and i can be a numeric or logical vector.
在下面的代码片段,x,object,e1和e2是XIntegerViews的对象,和i可以是一个数字或逻辑的向量。
x[[i]]: Extract a view as an XInteger object. i must be a single numeric value (a numeric vector of length 1). Can't be used for extracting a view that is "out of limits" (raise an error). The returned object has the same XInteger subtype as subject(x).
x[[i]]:提取作为XInteger对象的观点。 i必须是一个单一的数值(长度为1的数字向量)。不能用于提取一个观点,就是“超出限制”(引发错误)。返回的对象有相同subject(x)XInteger亚型。
e1 == e2: A vector of logicals indicating the result of the view by view comparison. The views in the shorter of the two XIntegerViews object being compared are recycled as necessary.
e1 == e2:一个逻辑值的向量表示的观点比较的角度。在对象被比较的两个XIntegerViews较短的意见是必要的回收。
e1 != e2: Equivalent to !(e1 == e2).
e1 != e2:!(e1 == e2)等效。
作者(S)----------Author(s)----------
P. Aboyoun
参见----------See Also----------
Views-class, XInteger-class, Views-utils, XDoubleViews-class
意见级,XInteger级,视图-utils的,XDoubleViews级
举例----------Examples----------
## One standard way to create an XIntegerViews object is to use[一个标准的方式来创建一个XIntegerViews对象是使用]
## the Views() constructor:[#的意见()构造:]
subject <- as(c(45, 67, 84, 67, 45, 78), "XInteger")
v4 <- Views(subject, start=3:0, end=5:8)
v4
subject(v4)
length(v4)
start(v4)
end(v4)
width(v4)
## Attach a comment to views #3 and #4:[#附加意见,#3和#4的评论:]
names(v4)[3:4] <- "out of limits"
names(v4)
## A more programatical way to "tag" the "out of limits" views:[#更programatical的的方式“标签”的意见“限制了”:]
idx <- start(v4) < 1 | end(v4) > length(subject(v4))
names(v4)[idx] <- "out of limits"
## Extract a view as an XInteger object:[#提取作为XInteger对象的看法:]
v4[[2]]
## It is an error to try to extract an "out of limits" view:[#这是一个错误尝试提取出“意见”限制:]
## Not run: [#无法运行:]
v4[[3]] # Error![错误!]
## End(Not run)[#结束(不运行)]
## Here the first view doesn't even overlap with the subject:[#这里的第一种观点,甚至不重叠的主题:]
subject <- as(c(97, 97, 97, 45, 45, 98), "XInteger")
Views(subject, start=-3:4, end=-3:4 + c(3:6, 6:3))
转载请注明:出自 生物统计家园网(http://www.biostatistic.net)。
注:
注1:为了方便大家学习,本文档为生物统计家园网机器人LoveR翻译而成,仅供个人R语言学习参考使用,生物统计家园保留版权。
注2:由于是机器人自动翻译,难免有不准确之处,使用时仔细对照中、英文内容进行反复理解,可以帮助R语言的学习。
注3:如遇到不准确之处,请在本贴的后面进行回帖,我们会逐渐进行修订。
|