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

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

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

                                        Rle objects
                                         RLE对象

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

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

The Rle class is a general container for storing an atomic vector that is stored in a run-length encoding format. It is based on the rle function from the base package.
本的RLE类是为存储在运行长度编码格式存储的向量,一个原子的一般容器。它是基于rle从基础包的功能。


构造----------Constructors----------

Rle(values): This constructor creates an Rle instances out of an atomic vector values.
Rle(values):此构造函数创建了一个原子的矢量valuesRLE实例。

Rle(values, lengths): This constructor creates an Rle instances out of an atomic vector or factor object values and an integer or numeric vector lengths with all positive elements that represent how many times each value is repeated. The length of these two vectors must be the same.
Rle(values, lengths):此构造函数创建一个原子的矢量或因素对象RLE实例values“整数或数字向量lengths一切积极因素,表示每个值重复多少次。这两个向量的长度必须是相同的。

as(from, "Rle"): This constructor creates an Rle instances out of an atomic vector from.
as(from, "Rle"):此构造函数创建了一个原子的矢量fromRLE实例。


存取----------Accessors----------

In the code snippets below, x is an Rle object:
在下面的代码片段,x是一个RLE对象:

runLength(x): Returns the run lengths for x.
runLength(x):返回x的运行长度。

runValue(x): Returns the run values for x.
runValue(x):返回x的运行值。

nrun(x): Returns the number of runs in x.
nrun(x):在x返回的班次。

start(x): Returns the starts of the runs for x.
start(x):返回x的开始运行。

end(x): Returns the ends of the runs for x.
end(x):返回x的两端运行。

width(x): Same as runLength(x).
width(x):同为runLength(x)。


替代品----------Replacers----------

In the code snippets below, x is an Rle object:
在下面的代码片段,x是一个RLE对象:

runLength(x) <- value: Replaces x with a new Rle object using run values runValue(x) and run lengths value.
runLength(x) <- value:替换x一个新的的RLE对象运行值runValue(x)和运行长度value。

runValue(x) <- value: Replaces x with a new Rle object using run values value and run lengths runLength(x).
runValue(x) <- value:替换x一个新的的RLE对象运行值value和运行长度runLength(x)。


强迫----------Coercion----------

In the code snippets below, x and from are Rle objects:
在下面的代码片段,x和fromRLE对象:

as.vector(x, mode = "any"), as(from, "vector"): Creates an atomic vector based on the values contained in x. The vector will be coerced to the requested mode, unless mode is "any", in which case the most appropriate type is chosen.
as.vector(x, mode = "any"),as(from, "vector"):创建一个原子的向量在根据x包含的值。向量将被强制要求mode,除非mode是“任何”,在这种情况下,选择最合适的类型。

as.vectorORfactor(x): Creates an atomic vector or factor, based on the type of values contained in x. This is the most general way to decompress the Rle to a native R data structure.
as.vectorORfactor(x):创建一个原子的矢量或因素,基于在x中包含的值的类型。这是最普遍的方式解压缩,RLE本地的R数据结构。

as.logical(x), as(from, "logical"): Creates a logical vector based on the values contained in x.
as.logical(x),as(from, "logical"):创建一个逻辑向量根据x包含的值。

as.integer(x), as(from, "integer"): Creates an integer vector based on the values contained in x.
as.integer(x),as(from, "integer"):创建一个整数向量在根据x包含的值。

as.numeric(x), as(from, "numeric"): Creates a numeric vector based on the values contained in x.
as.numeric(x),as(from, "numeric"):创建一个数字向量上根据x包含的值。

as.complex(x), as(from, "complex"): Creates a complex vector based on the values contained in x.
as.complex(x),as(from, "complex"):创建一个复杂的向量上根据x包含的值。

as.character(x), as(from, "character"): Creates a character vector based on the values contained in x.
as.character(x),as(from, "character"):创建一个基于根据x包含的值的特征向量。

as.raw(x), as(from, "raw"): Creates a raw vector based on the values contained in x.
as.raw(x),as(from, "raw"):创建一个原始向量根据x包含的值。

as.factor(x), as(from, "factor"): Creates a factor object based on the values contained in x.
as.factor(x),as(from, "factor"):创建一个因素对象根据x包含的值。

as.data.frame(x), as(from, "data.frame"): Creates a data.frame with a single column holding the result of as.vector(x).
as.data.frame(x),as(from, "data.frame"):创建一个单一列data.frame控股as.vector(x)结果。

as(from, "IRanges"): Creates an IRanges instance from a logical Rle. Note that this instance is guaranteed to be normal.
as(from, "IRanges"):创建从逻辑RLE IRanges,例如。请注意,此实例保证是正常的。

as(from, "NormalIRanges"): Creates a NormalIRanges instance from a logical Rle.
as(from, "NormalIRanges"):创建一个从逻辑RLE NormalIRanges实例。


集团泛型----------Group Generics----------

Rle objects have support for S4 group generic functionality:
RLE对象有S4组的通用功能的支持:




Arith "+", "-", "*", "^",
Arith"+","-","*","^"




Compare "==", ">", "<", "!=",
Compare"==",">","<","!="




Logic "&amp;", "|"
Logic"&amp;","|"




Ops "Arith", "Compare", "Logic"
Ops"Arith","Compare","Logic"




Math "abs", "sign", "sqrt", "ceiling", "floor", "trunc", "cummax", "cummin", "cumprod", "cumsum", "log", "log10", "log2", "log1p", "acos", "acosh", "asin", "asinh", "atan", "atanh", "exp", "expm1", "cos", "cosh", "sin", "sinh", "tan", "tanh",
Math"abs","sign","sqrt","ceiling","floor","trunc","cummax",<X >,"cummin","cumprod","cumsum","log","log10","log2","log1p","acos" "acosh","asin","asinh","atan","atanh","exp","expm1","cos", "cosh","sin","sinh","tan"




Math2 "round", "signif"
Math2"round","signif"




Summary "max", "min", "range",
Summary"max","min","range"




Complex "Arg", "Conj", "Im",
Complex"Arg","Conj","Im"

See S4groupGeneric for more details.
详情请参阅S4groupGeneric。


一般方法----------General Methods----------

In the code snippets below, x is an Rle object:
在下面的代码片段,x是一个RLE对象:

x[i, drop = !is.null(getOption("dropRle")) &amp;&amp; getOption("dropRle")]: Subsets x by index i, where i can be positive integers, negative integers, a logical vector of the same length as x, an Rle object of the same length as x containing logical values, or an IRanges object. When drop = FALSE returns an Rle object. When drop = TRUE, returns an atomic vector.
x[i, drop = !is.null(getOption("dropRle")) &amp;&amp; getOption("dropRle")]:亚群x通过索引i,其中i可以是正整数,负整数,为x相同长度的逻辑向量,一个RLE x长度相同的对象包含逻辑值,或IRanges对象。当drop = FALSE返回一个RLE的对象。当drop = TRUE,返回一个原子的向量。

x[i] <- value: Equivalent to seqselect(x, i) <- value.
x[i] <- value:seqselect(x, i) <- value等效。

x %in% table: Returns a logical Rle representing set membership in table.
x %in% table:返回一个逻辑RLE组成员代表在table。

aggregate(x, by, FUN, start = NULL, end = NULL, width = NULL,       frequency = NULL, delta = NULL, ..., simplify = TRUE)): Generates summaries on the specified windows and returns the result in a convenient form:
aggregate(x, by, FUN, start = NULL, end = NULL, width = NULL,       frequency = NULL, delta = NULL, ..., simplify = TRUE)):对指定的窗口生成摘要,并在方便的形式返回结果:




by An object with start, end, and
by一个与start,end,对象和




FUN The function, found via match.fun, to be
FUN的功能,通过match.fun发现,是




start, end, width the start, end, or width of the window. If by is missing, then must supply two of the
start,end,width开始,结束,或窗口的宽度。 by如果丢失,则必须提供两个




frequency, delta Optional arguments that specify
frequency,delta可选参数指定




... Further arguments for FUN.
... FUN进一步的论据。




simplify A logical value specifying whether or not the
simplify一个逻辑值,指明是否

append(x, values, after = length(x)): Insert one Rle into another Rle.
append(x, values, after = length(x)):插入一个又一个的RLE RLE。




values the Rle to insert.
values的RLE插入。




after the subscript in x after which the values
afterx后的值标

c(x, ...): Combines a set of Rle objects.
c(x, ...):结合RLE对象的集合。

findRange(x, vec): Returns an IRanges object representing the ranges in Rle vec that are referenced by the indices in the integer vector x.
findRange(x, vec)参考指数在整数向量vecx:返回一个IRanges反对RLE代表的范围。

findRun(x, vec): Returns an integer vector indicating the run indices in Rle vec that are referenced by the indices in the integer vector x.
findRun(x, vec):返回一个整数的向量表示RLE运行指标vec指数在整数向量x引用。

head(x, n = 6L): If n is non-negative, returns the first n elements of x. If n is negative, returns all but the last abs(n) elements of x.
head(x, n = 6L)如果n非负,返回第n个元素的x。 n如果是负,返回所有,但最后abs(n)x元素。

is.na(x): Returns a logical Rle indicating with values are NA.
is.na(x):返回值,指示逻辑RLENA。

is.unsorted(x, na.rm = FALSE, strictly = FALSE): Returns a logical value specifying if x is unsorted.
is.unsorted(x, na.rm = FALSE, strictly = FALSE):返回一个逻辑值,指定如果x无序。




na.rm remove missing values from check.
na.rm从检查中删除缺失值。




strictly check for _strictly_ increasing values.
strictly检查为_strictly_增加值的。

length(x): Returns the underlying vector length of x.
length(x):返回x的基本向量的长度。

match(x, table, nomatch = NA_integer_, incomparables = NULL): Matches the values in x to table:
match(x, table, nomatch = NA_integer_, incomparables = NULL):匹配x的值table




table the values to be matched against.
table匹配的值。




nomatch the value to be returned in the case when no
nomatch的情况下返回值时,没有




incomparables a vector of values that cannot be matched. Any value in x matching a value in this vector is assigned
incomparables不能匹配值的向量。任何在x匹配一个值,在此向量的值赋给

rep(x, times, length.out, each), rep.int(x, times): Repeats the values in x through one of the following conventions:
rep(x, times, length.out, each),rep.int(x, times):重复值x通过以下约定:




times Vector giving the number of times to repeat each element if of length length(x), or to repeat the whole vector
times向量的次数重复每个元素如果长length(x),或重复整个向量




length.out Non-negative integer. The desired length of
length.out非负整数。所需的长度




each Non-negative integer.  Each element of x is
each非负整数。每个x元素

rev(x): Reverses the order of the values in x.
rev(x):在x值的顺序反转。

seqselect(x, start = NULL, end = NULL, width = NULL): Creates a new Rle object using consecutive subsequences from x specified by two of the three following values:  start, end, and width. See seqselect for more details.
seqselect(x, start = NULL, end = NULL, width = NULL):创建一个新的RLE对象,使用连续子序列从x指定由两个以下三个值:start,end,width。详情请参阅seqselect。

seqselect(x, start=NULL, end=NULL, width=NULL) <- value: Similar to window<-, except that multiple consecutive subsequences can be replaced by a constant value. As such two of the three start, end, and width arguments can be used to specify the consecutive subsequences. Alternatively, start can take a Ranges object or something that can be converted to a Ranges object like an integer vector, logical vector or logical Rle.
seqselect(x, start=NULL, end=NULL, width=NULL) <- value:类似window<-,除了多个连续子序列可以由一个常数value取代。作为这样两个三个start,end,width参数可以用来指定连续子序列。另外,start可以采取范围对象或东西可以转化为像一个整数向量,向量逻辑或逻辑RLE的范围对象。

shiftApply(SHIFT, X, Y, FUN, ..., OFFSET = 0L, simplify = TRUE, verbose = FALSE): Let i be the indices in SHIFT, X_i = window(X, 1 + OFFSET, length(X) - SHIFT[i]), and Y_i = window(Y, 1 + SHIFT[i], length(Y) - OFFSET). Calculates the set of FUN(X_i, Y_i, ...) values and return the results in a convenient form:
shiftApply(SHIFT, X, Y, FUN, ..., OFFSET = 0L, simplify = TRUE, verbose = FALSE):让i是SHIFT,X_i = window(X, 1 + OFFSET, length(X) - SHIFT[i]),Y_i = window(Y, 1 + SHIFT[i], length(Y) - OFFSET)指数。 FUN(X_i, Y_i, ...)值计算,并在方便的形式返回结果:




SHIFT A non-negative integer vector of shift values.
SHIFT移值的非负整数向量。




X, Y The Rle objects to shift.
X,Y的RLE对象转移。




FUN The function, found via match.fun, to be
FUN的功能,通过match.fun发现,是




... Further arguments for FUN.
... FUN进一步的论据。




OFFSET A non-negative integer offset to maintain throughout
抵消了非负整数偏移保持整个




simplify A logical value specifying whether or not the
simplify一个逻辑值,指明是否




verbose A logical value specifying whether or not to
verbose一个逻辑值,指定是否

show(object): Prints out the Rle object in a user-friendly way.
show(object):打印出的RLE对象在用户友好的方式。

sort(x, decreasing = FALSE, na.last = NA): Sorts the values in x.
sort(x, decreasing = FALSE, na.last = NA):x值进行排序。




decreasing If TRUE, sort values in decreasing
decreasing如果TRUE,排序值降低




na.last If TRUE, missing values are placed last. If FALSE, they are placed first. If NA, they are
na.last如果TRUE,遗漏值是放在最后。如果FALSE,它们被放在第一。如果NA,他们

split(x, f, drop = FALSE): Splits x according to f to create a CompressedRleList object. Empty list elements are removed if drop is TRUE.
split(x, f, drop = FALSE):拆分x根据f创建一个CompressedRleList对象。如果drop是TRUE空列表元素被删除。

splitRanges(x): Returns a CompressedIRangesList object that contain the ranges for each of the unique run values.
splitRanges(x):返回一个CompressedIRangesList对象包含为每个独特的运行值的范围。

subset(x, subset): Returns a new Rle object made of the subset using logical vector subset.
subset(x, subset):返回一个新的RLE使用逻辑向量subset子集的对象。

summary(object, ..., digits = max(3, getOption("digits") - 3)): Summarizes the Rle object using an atomic vector convention. The digits argument is used for number formatting with signif().
summary(object, ..., digits = max(3, getOption("digits") - 3)):总结RLE对象,用原子向量公约。用于数字格式与digitssignif()参数。

table(...): Returns a table containing the counts of the unique values.
table(...):返回一个包含唯一值计数。

tail(x, n = 6L): If n is non-negative, returns the last n elements of x. If n is negative, returns all but the first abs(n) elements of x.
tail(x, n = 6L):n如果是为非负数,返回最后的xn个元素。 n如果是负,返回所有,但第一abs(n)x元素。

unique(x, incomparables = FALSE, ...): Returns the unique run values. The incomparables argument takes a vector of values that cannot be compared with FALSE being a special value that means that all values can be compared.
unique(x, incomparables = FALSE, ...):返回独特的运行值。 incomparables参数需要一个不能FALSE是一个特殊的值,这意味着所有的值可以比较比较值的向量。

window(x, start = NA, end = NA, width = NA, frequency = NULL, delta = NULL, ...): Extract the subsequence window from x specified by:
window(x, start = NA, end = NA, width = NA, frequency = NULL, delta = NULL, ...):x指定从提取的子序列的窗口:




start, end, width The start, end, or width
start,end,width开始,结束或宽度




frequency, delta Optional arguments that specify
frequency,delta可选参数指定

window(x, start = NA, end = NA, width = NA, keepLength = TRUE) <- value: Replace the subsequence window specified on the left (i.e. the subsequence in x specified by start, end and width) by value. value must either be of class Rle, belong to a subclass of Rle, be coercible to Rle, or be NULL. If keepLength is TRUE, the elements of value are repeated to create an Rle with the same number of elements as the width of the subsequence window it is replacing. If keepLength is FALSE, this replacement method can modify the length of x, depending on how the length of the left subsequence window compares to the length of value.
window(x, start = NA, end = NA, width = NA, keepLength = TRUE) <- value:更换序列左侧指定的窗口(即序列在xstart中指定,end和width)value的 。 value必须是类的RLE,属于RLE的一个子类,强制转换RLE,或者是NULL。如果keepLength是TRUE,元素value重复创建相同数量的元素的宽度序列窗口,它正在取代RLE。如果keepLength是FALSE,此替代方法可以修改的长度x,取决于左序列窗口的长度如何比较长的value。


逻辑数据方法----------Logical Data Methods----------

In the code snippets below, x is an Rle object:
在下面的代码片段,x是一个RLE对象:

!x: Returns logical negation (NOT) of x.
!x:返回逻辑否定x(不)。

which(x): Returns an integer vector representing the TRUE indices of x.
which(x):返回一个整数向量代表的TRUEx指数。

ifelse(x, yes, no): For each element of x, returns the corresponding element in yes if TRUE, otherwise the element in no. yes and no may be Rle objects or anything else coercible to a vector.
ifelse(x, yes, no):x对于每个元素,返回相应的元素yes如果TRUE,否则元素no。 yes和no可能Rle对象或其他任何强制转换到一个向量。


数值型数据的方法----------Numerical Data Methods----------

In the code snippets below, x is an Rle object:
在下面的代码片段,x是一个RLE对象:

diff(x, lag = 1, differences = 1: Returns suitably lagged and iterated differences of x.
diff(x, lag = 1, differences = 1:返回x的适当滞后和迭代的差异。




lag An integer indicating which lag to use.
lag于一个整数,指示哪些使用。




differences An integer indicating the order of the
differences一个整数,指示的顺序

pmax(..., na.rm = FALSE), pmax.int(..., na.rm = FALSE): Parallel maxima of the Rle input values. Removes NAs when na.rm = TRUE.
pmax(..., na.rm = FALSE),pmax.int(..., na.rm = FALSE):平行的RLE输入值的最大值。移除NASna.rm = TRUE。

pmin(..., na.rm = FALSE), pmin.int(..., na.rm = FALSE): Parallel minima of the Rle input values. Removes NAs when na.rm = TRUE.
pmin(..., na.rm = FALSE),pmin.int(..., na.rm = FALSE):平行的RLE输入值极小。移除NASna.rm = TRUE。

mean(x, na.rm = FALSE): Calculates the mean of x. Removes NAs when na.rm = TRUE.
mean(x, na.rm = FALSE):计算平均x。移除NASna.rm = TRUE。

var(x, y = NULL, na.rm = FALSE): Calculates the variance of x or covariance of x and y if both are supplied. Removes NAs when na.rm = TRUE.
var(x, y = NULL, na.rm = FALSE):x或协方差计算方差x和y如果两者都提供。移除NASna.rm = TRUE。

cov(x, y, use = "everything"), cor(x, y, use = "everything"): Calculates the covariance and correlation respectively of Rle objects x and y. The use argument is an optional character string giving a method for computing covariances in the presence of missing values. This must be (an abbreviation of) one of the strings "everything", "all.obs", "complete.obs", "na.or.complete", or "pairwise.complete.obs".
cov(x, y, use = "everything"),cor(x, y, use = "everything"):计算的RLE对象x和y的协方差和相关性分别。 use参数是一个可选的字符串,给人一种存在缺失值的计算协方差的方法。这必须是(缩写)字符串"everything","all.obs","complete.obs","na.or.complete"或"pairwise.complete.obs"。

sd(x, na.rm = FALSE): Calculates the standard deviation of x. Removes NAs when na.rm = TRUE.
sd(x, na.rm = FALSE):计算x的标准偏差。移除NASna.rm = TRUE。

median(x, na.rm = FALSE): Calculates the median of x. Removes NAs when na.rm = TRUE.
median(x, na.rm = FALSE):计算x的中位数。移除NASna.rm = TRUE。

quantile(x, probs = seq(0, 1, 0.25), na.rm = FALSE, names = TRUE, type = 7, ...): Calculates the specified quantiles of x.
quantile(x, probs = seq(0, 1, 0.25), na.rm = FALSE, names = TRUE, type = 7, ...):计算x指定的位数。




probs A numeric vector of probabilities with values in
probs一个数字的概率向量的值




na.rm If TRUE, removes NAs from x
na.rm如果TRUE,从NA删除xS




names If TRUE, the result has names describing the
names如果TRUE,结果有名称描述




type An integer between 1 and 9 selecting one of the nine
type1和9之间的整数选择的九个之一




... Further arguments passed to or from other methods.
...进一步传递的参数或其他方法。

mad(x, center = median(x), constant = 1.4826, na.rm = FALSE, low = FALSE, high = FALSE): Calculates the median absolute deviation of x.
mad(x, center = median(x), constant = 1.4826, na.rm = FALSE, low = FALSE, high = FALSE):计算x的中位数绝对偏差。




center The center to calculate the deviation from.
center来计算偏离中心。




constant The scale factor.
constant比例因子。




na.rm If TRUE, removes NAs from x
na.rm如果TRUE,从NA删除xS




low If TRUE, compute the 'lo-median'.
low如果TRUE,计算“中位数”。




high If TRUE, compute the 'hi-median'.
high如果TRUE,计算出“喜中位数”。

IQR(x, na.rm = FALSE): Calculates the interquartile range of x.
IQR(x, na.rm = FALSE):计算x的四分位数范围。




na.rm If TRUE, removes NAs from x
na.rm如果TRUE,从NA删除xS

smoothEnds(y, k = 3): Smooth end points of an Rle y using subsequently smaller medians and Tukey's end point rule at the very end.
smoothEnds(y, k = 3):平滑终点的RLEy随后较小的中位数和杜克在最后结束的规则。




k An integer indicating the width of largest median
k一个整数,表示最大的中位数的宽度

runmean(x, k, endrule = c("drop", "constant")): Calculates the means for fixed width running windows across x.
runmean(x, k, endrule = c("drop", "constant")):计算固定跨越x运行窗口的宽度的手段。




k An integer indicating the fixed width of the running
k一个整数,指示正在运行的固定宽度




endrule A character string indicating how the values at the beginning and the end (of the data) should be treated.
endrule说明如何在开头和结尾(数据)的值应被视为一个字符串。




"drop" do not extend the running statistics to
"drop"不延长运行统计




"constant" copies running statistic to the first values and analogously for the last ones making the
"constant"运行统计数据复制到第一个值,并比照最后的使

runmed(x, k, endrule = c("median", "keep", "drop", "constant")): Calculates the medians for fixed width running windows across x.
runmed(x, k, endrule = c("median", "keep", "drop", "constant")):跨越x运行窗口为固定宽度的计算中位数。




k An integer indicating the fixed width of the running
k一个整数,指示正在运行的固定宽度




endrule A character string indicating how the values at the beginning and the end (of the data) should be treated.
endrule说明如何在开头和结尾(数据)的值应被视为一个字符串。




"keep" keeps the first and last k2 values at both ends, where k2 is the half-bandwidth k2 = k %/% 2, i.e., y[j] = x[j] for j \in \{1,&hellip;,k_2; n-k_2+1,&hellip;,n\}
"keep"保持第一个和最后一个k2两端值,其中k2是半带宽k2 = k %/% 2,即y[j] = x[j]j \in \{1,&hellip;,k_2; n-k_2+1,&hellip;,n\}




"constant" copies the running statistic to the first values and analogously for the last ones making the
"constant"运行统计到的第一个值复制,并比照为使最后的




"median" the default, smooths the ends by using symmetrical medians of subsequently smaller bandwidth, but for the very first and last value where Tukey's robust
"median"默认情况下,平滑随后较小的带宽使用对称中线的两端,但Tukey的强劲的第一个和最后一个值

runsum(x, k, endrule = c("drop", "constant")): Calculates the sums for fixed width running windows across x.
runsum(x, k, endrule = c("drop", "constant")):计算固定跨越x运行窗口的宽度的总和。




k An integer indicating the fixed width of the running
k一个整数,指示正在运行的固定宽度




endrule A character string indicating how the values at the beginning and the end (of the data) should be treated.
endrule说明如何在开头和结尾(数据)的值应被视为一个字符串。




"drop" do not extend the running statistics to
"drop"不延长运行统计




"constant" copies running statistic to the first values and analogously for the last ones making the
"constant"运行统计数据复制到第一个值,并比照最后的使

runwtsum(x, k, wt, endrule = c("drop", "constant")): Calculates the sums for fixed width running windows across x.
runwtsum(x, k, wt, endrule = c("drop", "constant")):计算固定跨越x运行窗口的宽度的总和。




k An integer indicating the fixed width of the running
k一个整数,指示正在运行的固定宽度




wt A numeric vector of length k that
wt一个数字矢量长度k,




endrule A character string indicating how the values at the beginning and the end (of the data) should be treated.
endrule说明如何在开头和结尾(数据)的值应被视为一个字符串。




"drop" do not extend the running statistics to
"drop"不延长运行统计




"constant" copies running statistic to the first values and analogously for the last ones making the
"constant"运行统计数据复制到第一个值,并比照最后的使

runq(x, k, i, endrule = c("drop", "constant")): Calculates the order statistic for fixed width running windows across x.
runq(x, k, i, endrule = c("drop", "constant")):计算跨越x运行窗口的宽度固定的次序统计量。




k An integer indicating the fixed width of the running
k一个整数,指示正在运行的固定宽度




i An integer indicating which order statistic to
i一个整数,指示顺序统计




endrule A character string indicating how the values at the beginning and the end (of the data) should be treated.
endrule说明如何在开头和结尾(数据)的值应被视为一个字符串。




"drop" do not extend the running statistics to
"drop"不延长运行统计




"constant" copies running statistic to the first values and analogously for the last ones making the
"constant"运行统计数据复制到第一个值,并比照最后的使


字符数据的方法----------Character Data Methods----------

In the code snippets below, x is an Rle object:
在下面的代码片段,x是一个RLE对象:

nchar(x, type = "chars", allowNA = FALSE): Returns an integer Rle representing the number of characters in the corresponding values of x.
nchar(x, type = "chars", allowNA = FALSE):x相应的值中的字符数返回一个整数,RLE。




type One of c("bytes", "chars", "width").
type1c("bytes", "chars", "width")。




allowNA Should NA be returned for invalid multibyte
allowNA如果NA返回无效的多字节

substr(x, start, stop), substring(text, first, last = 1000000L): Returns a character or factor Rle containing the specified substrings beginning at start/first and ending at stop/last.
substr(x, start, stop),substring(text, first, last = 1000000L):返回字符或因素的RLE包含指定的子串开始在start/first和stop/last结束。

chartr(old, new, x): Returns a character or factor Rle containing a translated version of x.
chartr(old, new, x):返回字符或因素RLE含有x译本。




old A character string specifying the characters to be
old字符串指定的字符




new A character string specifying the translations.
new一个字符串指定的翻译。

tolower(x): Returns a character or factor Rle containing a lower case version of x.
tolower(x):返回字符或因素RLE包含小写版本的x。

toupper(x): Returns a character or factor Rle containing an upper case version of x.
toupper(x):返回字符或因素RLE包含x的大写版本。

sub(pattern, replacement, x, ignore.case = FALSE,         perl = FALSE, fixed = FALSE, useBytes = FALSE): Returns a character or factor Rle containing replacements based on matches determined by regular expression matching. See sub for a description of the arguments.
sub(pattern, replacement, x, ignore.case = FALSE,         perl = FALSE, fixed = FALSE, useBytes = FALSE):返回字符或因素RLE基于正则表达式匹配决定比赛的替代品。看到sub参数的描述。

gsub(pattern, replacement, x, ignore.case = FALSE,  perl = FALSE, fixed = FALSE, useBytes = FALSE): Returns a character or factor Rle containing replacements based on matches determined by regular expression matching. See gsub for a description of the arguments.
gsub(pattern, replacement, x, ignore.case = FALSE,  perl = FALSE, fixed = FALSE, useBytes = FALSE):返回字符或因素RLE基于正则表达式匹配决定比赛的替代品。看到gsub参数的描述。

paste(..., sep = " ", collapse = NULL): Returns a character or factor Rle containing a concatenation of the values in ....
paste(..., sep = " ", collapse = NULL):返回字符或因素RLE包含在...值的串联。


因子实验数据的方法----------Factor Data Methods----------

In the code snippets below, x is an Rle object:
在下面的代码片段,x是一个RLE对象:

levels(x), levels(x) <- value: Gets and sets the factor levels, respectively.
levels(x),levels(x) <- value:获取和设置因子水平,分别为。

nlevels(x): Returns the number of factor levels.
nlevels(x):返回因子水平。


作者(S)----------Author(s)----------


P. Aboyoun



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

rle, Vector-class, S4groupGeneric, IRanges-class
rle,媒介类,S4groupGeneric,IRanges级


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


  x <- Rle(10:1, 1:10)
  x

  runLength(x)
  runValue(x)
  nrun(x)

  diff(x)
  unique(x)
  sort(x)
  sqrt(x)
  x^2 + 2 * x + 1
  x[c(1,3,5,7,9)]
  window(x, 4, 14)
  range(x)
  table(x)
  sum(x)
  mean(x)
  x > 4
  aggregate(x, x > 4, mean)
  aggregate(x, FUN = mean, start = 1length(x) - 50), end = 51:length(x))

  y <- Rle(c(TRUE,TRUE,FALSE,FALSE,TRUE,FALSE,TRUE,TRUE,TRUE))
  y
  as.vector(y)
  rep(y, 10)
  c(y, x > 5)

  z <- c("the", "quick", "red", "fox", "jumps", "over", "the", "lazy", "brown", "dog")
  z <- Rle(z, seq_len(length(z)))
  chartr("a", "@", z)
  toupper(z)

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


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

使用道具 举报

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

本版积分规则

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

GMT+8, 2025-2-5 14:10 , Processed in 0.022333 second(s), 15 queries .

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

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