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

R语言 IRanges包 Ranges-comparison()函数中文帮助文档(中英文对照)

[复制链接]
发表于 2012-2-25 22:30:17 | 显示全部楼层 |阅读模式
Ranges-comparison(IRanges)
Ranges-comparison()所属R语言包:IRanges

                                        Ranges comparison
                                         范围比较

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

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

Equality and ordering of ranges, and related methods.
平等和范围,以及相关的方法订购。


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


## ==== Equality and related methods ====
## --------------------------------------

## S4 method for signature 'Ranges,Ranges'
e1 == e2

## S4 method for signature 'Ranges,Ranges'
e1 != e2

## S4 method for signature 'Ranges'
duplicated(x, incomparables=FALSE, fromLast=FALSE,
           method=c("auto", "quick", "hash"), ...)

## S4 method for signature 'Ranges'
unique(x, incomparables=FALSE, fromLast=FALSE,
       method=c("auto", "quick", "hash"), ...)

## ==== Ordering and related methods ====
## --------------------------------------

## S4 method for signature 'Ranges,Ranges'
e1 <= e2
## S4 method for signature 'Ranges,Ranges'
e1 >= e2
## S4 method for signature 'Ranges,Ranges'
e1 < e2
## S4 method for signature 'Ranges,Ranges'
e1 > e2

## S4 method for signature 'Ranges'
order(..., na.last=TRUE, decreasing=FALSE)

## S4 method for signature 'Ranges'
sort(x, decreasing=FALSE, ...)

## S4 method for signature 'Ranges'
rank(x, na.last=TRUE,
     ties.method=c("average", "first", "random", "max", "min"))



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

参数:e1,e2,x
Ranges objects.  
范围对象。


参数:incomparables
Must be FALSE.  
必须FALSE。


参数:fromLast
See default S3 method for duplicated.  
duplicated看到默认S3方法。


参数:method
Use a Quicksort-based (method="quick") or a hash-based (method="hash") algorithm. The latter tends to give better performance, except maybe for some pathological input that we've not been able to determine so far. When method="auto" is specified, the hash-based algorithm is used as long as the length of x is <= 2^29, otherwise the Quicksort-based algorithm is used.  
用基于快速排序(method="quick")或基于散列(method="hash")算法。后者往往以提供更好的性能,可能除了一些病理的输入,我们已经无法确定到目前为止。当method="auto"指定的长度只要使用基于散列的算法x<= 2 ^ 29,否则用基于快速排序的算法。


参数:...
Ranges objects for order.  
order范围对象。


参数:na.last
Ignored.  
忽略。


参数:decreasing
TRUE or FALSE.  
TRUE或FALSE。


参数:ties.method
A character string specifying how ties are treated. Only "first" is supported for now.  
一个字符串指定的关系如何处理。只有"first"现在的支持。


Details

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

Two ranges are considered equal iff they share the same start and width. Note that with this definition, 2 empty ranges are generally not equal (they need to share the same start to be considered equal). This means that, when it comes to comparing ranges, an empty range is interpreted as a position between its end and start. For example, a typical usecase is comparison of insertion points defined along a string (like a DNA sequence) and represented as empty ranges.
两个范围被认为是平等的,当且仅当它们共享相同的起点和宽度。请注意,这个定义,2个空的范围一般不等于(被认为是相等的,他们需要共享相同的开始)。这意味着,当涉及到比较范围,一个空的范围解释之间的结束和开始的位置。例如,一个典型的用例是沿着一个字符串(如DNA序列)定义,并表示为空范围的插入点的比较。

Ranges are ordered by starting position first, and then by width. This way, the space of ranges is totally ordered. The order, sort and rank methods for Ranges objects are consistent with this order.
下令开始第一的位置,然后由宽度范围。这样一来,空间范围是完全有序。 order,sort和rank范围对象,方法与这个顺序一致。

duplicated(x): Determines which elements of x are equal to elements with smaller subscripts, and returns a logical vector indicating which elements are duplicates. It is semantically equivalent to duplicated(as.data.frame(x)). See duplicated in the base package for more details.
duplicated(x):确定哪些元素x等于标较小的元素,并返回一个逻辑向量,说明哪些元素是重复的。它是语义等价的duplicated(as.data.frame(x))。看到duplicated在基础包的更多细节。

unique(x): Removes duplicate ranges from x. See unique in the base package for more details.
unique(x):x删除重复的范围。看到unique在基础包的更多细节。

order(...): Returns a permutation which rearranges its first argument (a Ranges object) into ascending order, breaking ties by further arguments (also Ranges objects). See order in the base package for more details.
order(...):返回一个排列升序,打破了进一步论据(也山脉对象)的关系,重新设置了其第一个参数(范围对象)。看到order在基础包的更多细节。

sort(x): Sorts x. See sort in the base package for more details.
sort(x):排序x。看到sort在基础包的更多细节。

rank(x, na.last=TRUE, ties.method=c("average", "first", "random", "max", "min")): Returns the sample ranks of the ranges in x. See rank in the base package for more details.
rank(x, na.last=TRUE, ties.method=c("average", "first", "random", "max", "min")):返回x范围的样本行列。看到rank在基础包的更多细节。


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

Ranges-class, IRanges-class, duplicated, unique, order, sort, rank
范围类,IRanges级,duplicated,unique,order,sort,rank


举例----------Examples----------


  x <- IRanges(start=c(20L, 8L, 20L, 22L, 25L, 20L, 22L, 22L),
               width=c( 4L, 0L, 11L,  5L,  0L,  9L,  5L,  0L))
  x
  which(width(x) == 0)  # 3 empty ranges[3个空的范围]
  x[2] == x[2]  # TRUE[真]
  x[2] == x[5]  # FALSE[假]
  x == x[4]
  duplicated(x)
  unique(x)
  x >= x[3]
  order(x)
  sort(x)
  rank(x, ties.method="first")

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


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

使用道具 举报

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

本版积分规则

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

GMT+8, 2025-2-5 16:59 , Processed in 0.026350 second(s), 15 queries .

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

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