XDoubleViews-class(IRanges)
XDoubleViews-class()所属R语言包:IRanges
The XDoubleViews class
XDoubleViews类
译者:生物统计家园网 机器人LoveR
描述----------Description----------
The XDoubleViews class is the basic container for storing a set of views (start/end locations) on the same XDouble object.
XDoubleViews类是用于存储一组上相同XDouble对象的意见(开始/结束位置)的基本容器。
Details
详情----------Details----------
An XDoubleViews object contains a set of views (start/end locations) on the same XDouble object called "the subject numeric vector" or simply "the subject". Each view is defined by its start and end locations: both are integers such that start <= end. An XDoubleViews object is in fact a particular case of a Views object (the XDoubleViews 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.
一个XDoubleViews对象包含了一套被称为“受数字向量”或干脆“的主题是”在同一XDouble对象的意见(开始/结束位置)。每个视图定义其开始和结束的位置:两者都是整数,这样启动<=结束。对象是一个XDoubleViews实际上是一个视图对象(在XDoubleViews类包含视图类)的特殊情况,因此它可以以类似的方式操作:见?Views更多信息。注意两方面的意见,可以重叠和视图可以是“出”,即它可以启动的主题和/或结束前的最后一个元素之后的第一个元素的限制。
其他方法----------Other methods----------
In the code snippets below, x, object, e1 and e2 are XDoubleViews objects, and i can be a numeric or logical vector.
在下面的代码片段,x,object,e1和e2是XDoubleViews的对象,i可以是一个数字或逻辑的向量。
x[[i]]: Extract a view as an XDouble 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 XDouble subtype as subject(x).
x[[i]]:提取作为XDouble对象的观点。 i必须是一个单一的数值(长度为1的数字向量)。不能用于提取一个观点,就是“超出限制”(引发错误)。返回的对象有相同subject(x)XDouble亚型。
e1 == e2: A vector of logicals indicating the result of the view by view comparison. The views in the shorter of the two XDoubleViews object being compared are recycled as necessary.
e1 == e2:一个逻辑值的向量表示的观点比较的角度。在对象被比较的两个XDoubleViews较短的意见是必要的回收。
e1 != e2: Equivalent to !(e1 == e2).
e1 != e2:!(e1 == e2)等效。
作者(S)----------Author(s)----------
P. Aboyoun for the <code>XIntegerViews*</code> code, which was adapted to work
over <code>XDouble</code>'s by S. Lianoglou
参见----------See Also----------
Views-class, XDouble-class, Views-utils, XIntegerViews-class
视图 - 级的,XDouble级,点击-utils的,XIntegerViews级
举例----------Examples----------
## One standard way to create an XDoubleViews object is to use[一个标准的方式来创建一个XDoubleViews对象是使用]
## the Views() constructor:[#的意见()构造:]
subject <- as(rnorm(6), "XDouble")
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 XDouble object:[#提取作为XDouble对象的看法:]
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), "XDouble")
Views(subject, start=-3:4, end=-3:4 + c(3:6, 6:3))
## Some fast view* functionalities:[#一些快速视图*功能:]
x <- rnorm(55)
bounds <- IRanges(c(1, 11, 35, 20), width=c(5, 10, 15, 28))
v <- Views(x, bounds)
val <- viewMins(v)
expect <- sapply(1:length(bounds), function(i) {
min(x[start(bounds)[i]:end(bounds[i])])
})
stopifnot(all(val == expect))
转载请注明:出自 生物统计家园网(http://www.biostatistic.net)。
注:
注1:为了方便大家学习,本文档为生物统计家园网机器人LoveR翻译而成,仅供个人R语言学习参考使用,生物统计家园保留版权。
注2:由于是机器人自动翻译,难免有不准确之处,使用时仔细对照中、英文内容进行反复理解,可以帮助R语言的学习。
注3:如遇到不准确之处,请在本贴的后面进行回帖,我们会逐渐进行修订。
|