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

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

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

                                        The DataTable API
                                         DataTable的API

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

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

DataTable is an API only (i.e. virtual class with no slots) for accessing objects with a rectangular shape like DataFrame or RangedData objects. It mimics the API for standard data.frame objects.
DataTable是一个API,只为像长方形DataFrame或RangedData对象的访问对象(即无插槽虚拟类)。它模仿的标准数据框对象的API。


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

In the following code snippets, x is a DataTable.
在下面的代码片段,x是DataTable。

nrow(x), ncol(x): Get the number of rows and columns, respectively.
nrow(x),ncol(x):获取行和列的数量,分别。

NROW(x), NCOL(x): Same as nrow(x) and ncol(x), respectively.
NROW(x),NCOL(x):nrow(x)和ncol(x),分别相同。

dim(x): Length two integer vector defined as c(nrow(x), ncol(x)).
dim(x):长度两个整数向量定义为c(nrow(x), ncol(x))。

rownames(x), colnames(x): Get the names of the rows and columns, respectively.
rownames(x),colnames(x):获取行和列的名字,分别为。

dimnames(x): Length two list of character vectors defined as list(rownames(x), colnames(x)).
dimnames(x):长度两个特征向量定义为list(rownames(x), colnames(x))。


子集----------Subsetting----------

In the code snippets below, x is a DataTable object.
在下面的代码片段,x是一个DataTable对象。

x[i, j, drop=TRUE]: Return a new DataTable object made of the selected rows and columns. For single column selection, the drop argument specifies whether or not to coerce the returned sequence to a standard vector.
x[i, j, drop=TRUE]:返回一个新的DataTable对象中选定的行和列。为单个列的选择,drop参数指定是否要强迫返回的序列到一个标准的向量。

window(x, start = NA, end = NA, width = NA, frequency = NULL, delta = NULL, ...): Extract the subsequence window from the DataTable object using:
window(x, start = NA, end = NA, width = NA, frequency = NULL, delta = NULL, ...):提取从DataTable使用对象序列窗口:




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




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

In general, this is more efficient than using "[" operator.
在一般情况下,这是多使用"["运营商的有效。

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 class(x), belong to a subclass of class(x), be coercible to class(x), or be NULL. If keepLength is TRUE, the number of rows of value are repeated to create a DataTable with the same number of rows as the width of the subsequence window it is replacing. If keepLength is FALSE, this replacement method can modify the number of rows of x, depending on how the number of rows of the left subsequence window compares to the number of rows of value.
window(x, start = NA, end = NA, width = NA, keepLength = TRUE) <- value:更换序列左侧指定的窗口(即序列在xstart中指定,end和width)value的 。 value必须是类的class(x),属于一个子类的class(x),class(x),是强制转换或NULL。如果keepLength是TRUE行value反复与被更换的序列窗口的宽度相同数量的行创建一个DataTable。如果keepLength是FALSE,这个替代方法可以修改x,取决于左序列窗口的行数如何比较行数<行数X>。

seqselect(x, start=NULL, end=NULL, width=NULL): Similar to window, except that multiple subsequences can be requested. The requested subsequences are concatenated.
seqselect(x, start=NULL, end=NULL, width=NULL):类似window多个子序列,除了可以要求。请求的子序列连接在一起。

seqselect(x, start=NULL, end=NULL, width=NULL) <- value: Similar to window<-, except that multiple consecutive subsequences can be replaced by a value that spans those windows.
seqselect(x, start=NULL, end=NULL, width=NULL) <- value:类似window<-,除了多个连续子序列可以换成value跨越这些窗口。

head(x, n = 6L): If n is non-negative, returns the first n rows of the DataTable object. If n is negative, returns all but the last abs(n) rows of the DataTable object.
head(x, n = 6L):n如果非负,返回DataTable对象的前n行。 n如果是负,返回所有,但最后abs(n)DataTable对象的行。

tail(x, n = 6L): If n is non-negative, returns the last n rows of the DataTable object. If n is negative, returns all but the first abs(n) rows of the DataTable object.
tail(x, n = 6L):n如果非负,返回DataTable对象的最后n行。 n如果是负,返回所有,但第一abs(n)DataTable对象的行。

subset(x, subset, select, drop = FALSE): Return a new DataTable object using:
subset(x, subset, select, drop = FALSE):返回一个新的DataTable对象使用:




subset logical expression indicating rows to keep, where missing
指示行保持,缺少其中的子集的逻辑表达式




select expression indicating columns to keep.
选择表达式,表示要保持的列。




drop passed on to [ indexing operator.
下降传递到[索引运营商。

na.omit(object): Returns a subset with incomplete cases removed.
na.omit(object):返回不完整的情况下删除一个子集。

na.exclude(object): Returns a subset with incomplete cases removed (but to be included with NAs in statistical results).
na.exclude(object):返回删除不完整的情况下(但被列入统计的结果与NAS)的一个子集。

is.na(x): Returns a logical matrix indicating which cells are missing.
is.na(x):返回一个逻辑的矩阵表示缺少的单元。

complete.cases(x): Returns a logical vector identifying which cases have no missing values.
complete.cases(x):返回一个逻辑向量,确定情况没有缺失值。


结合----------Combining----------

In the code snippets below, x is a DataTable object.
在下面的代码片段,x是一个DataTable对象。

cbind(...): Creates a new DataTable by combining the columns of the DataTable objects in ....
cbind(...):创建一个新的DataTableDataTable的...对象的列相结合。

rbind(...): Creates a new DataTable by combining the rows of the DataTable objects in ....
rbind(...):创建一个新的DataTableDataTable行...对象相结合。


循环----------Looping----------

In the code snippets below, x is a DataTable object.
在下面的代码片段,x是一个DataTable对象。

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一个逻辑值,指明是否

by(data, INDICES, FUN, ..., simplify = TRUE): Apply FUN to each group of data, a DataTable, formed by the factor (or list of factors) INDICES. Exactly  the same contract as as.data.frame.
by(data, INDICES, FUN, ..., simplify = TRUE):申请FUN每个data组,DataTable,形成的因素(或因素列表)INDICES。正是as.data.frame相同的合同。


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




as.env(x, enclos = parent.frame()): Creates an environment from x with a symbol for each colnames(x). The values are not actually copied into the environment. Rather, they are dynamically bound using makeActiveBinding. This prevents unnecessary copying of the data from the external vectors into R vectors. The values are cached, so that the data is not copied every time the symbol is accessed.
as.env(x, enclos = parent.frame()):创造一种环境,从x每个colnames(x)的象征。值实际上并没有复制到环境中。相反,它们是动态绑定使用makeActiveBinding。这可以防止外部向量中的数据到R向量不必要的复制。值缓存,使数据不会被复制每次被访问时的符号。


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

DataTable-stats for statistical functionality, like fitting regression models, data.frame
DataTable中的统计功能统计,拟合回归模型一样,数据框


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


  showClass("DataTable")  # shows (some of) the known subclasses[表演(部分)已知的子类]

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


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

使用道具 举报

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

本版积分规则

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

GMT+8, 2025-2-5 13:51 , Processed in 0.020783 second(s), 16 queries .

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

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