combine(Biobase)
combine()所属R语言包:Biobase
Methods for Function combine in Package ‘Biobase’
函数方法相结合,在包BIOBASE
译者:生物统计家园网 机器人LoveR
描述----------Description----------
This generic function handles methods for combining or merging different Bioconductor data structures. It should, given an arbitrary number of arguments of the same class (possibly by inheritance), combine them into a single instance in a sensible way (some methods may only combine 2 objects, ignoring ... in the argument list; because Bioconductor data structures are complicated, check carefully that combine does as you intend).
这个泛型函数处理相结合或合并不同的Bioconductor数据结构的方法。它应该给任意数量的同一类的参数(可能是通过继承),结合他们在一个合理的方式(一些方法可能只有2个对象结合起来,忽略...在参数列表到一个单一的实例,因为bioconductor数据结构复杂,仔细检查combine不,你打算)。
用法----------Usage----------
combine(x, y, ...)
参数----------Arguments----------
参数:x
One of the values.
值之一。
参数:y
A second value.
第二个值。
参数:...
Any other objects of the same class as x and y.
相同的类作为x和y的任何其他对象。
Details
详情----------Details----------
There are two basic combine strategies. One is an intersection strategy. The returned value should only have rows (or columns) that are found in all input data objects. The union strategy says that the return value will have all rows (or columns) found in any one of the input data objects (in which case some indication of what to use for missing values will need to be provided).
有两个基本的联合战略。其中之一是一个十字路口的战略。返回值应该只被发现在所有的输入数据对象的行(或列)。联盟战略说,返回值将有任何一个输入数据对象(在这种情况下,将需要提供一些缺失值用什么迹象)中的所有行(或列)。
These functions and methods are currently under construction. Please let us know if there are features that you require.
这些函数和方法,目前正在建设中。请让我们知道,如果有您需要的功能。
值----------Value----------
A single value of the same class as the most specific common ancestor (in class terms) of the input values. This will contain the appropriate combination of the data in the input values.
一个最具体的共同祖先的输入值(类术语)的同一类的单个值。这将包含在输入值的数据的适当组合。
方法----------Methods----------
combine(x=ANY, missing) Return the first (x) argument
combine(x=ANY, missing)返回的第一个(X)参数
combine(data.frame, data.frame) Combines two data.frame objects so that the resulting data.frame contains all rows and columns of the original objects. Rows and columns in the returned value are unique, that is, a row or column represented in both arguments is represented only once in the result. To perform this operation, combine makes sure that data in shared rows and columns are identical in the two data.frames. Data differences in shared rows and columns usually cause an error. combine issues a warning when a column is a factor and the levels of the factor in the two
combine(data.frame, data.frame)结合了两种data.frame对象,以便产生data.frame包含原始对象的所有行和列。在返回的值的行和列都是独一无二的,是在双方的观点代表一行或一列表示,只有一次的结果。要执行此操作,combine确保共享的行和列中的数据是在两个data.frames相同。在共享的行和列数据的差异通常会导致一个错误。 combine发出警告时,一列是factor“在这两个级别的因素
combine(matrix, matrix) Combined two matrix objects so that the resulting matrix contains all rows and columns of the original objects. Both matricies must have dimnames. Rows and columns in the returned value are unique, that is, a row or column represented in both arguments is represented only once in the result. To perform this operation, combine makes sure that data in shared rows and
combine(matrix, matrix)结合两个matrix对象,这样的结果matrix包含原始对象的所有行和列。两种基质中必须有dimnames。在返回的值的行和列都是独一无二的,是在双方的观点代表一行或一列表示,只有一次的结果。要执行此操作,combine确保数据共享行
Additional combine methods are defined for AnnotatedDataFrame, AssayData, MIAME, and eSet classes and subclasses.
额外的combine方法被定义为AnnotatedDataFrame,AssayData,MIAME,eSet类和子类。
作者(S)----------Author(s)----------
Biocore
参见----------See Also----------
merge
merge
举例----------Examples----------
x <- data.frame(x=1:5,
y=factor(letters[1:5], levels=letters[1:8]),
row.names=letters[1:5])
y <- data.frame(z=3:7,
y=factor(letters[3:7], levels=letters[1:8]),
row.names=letters[3:7])
combine(x,y)
w <- data.frame(w=4:8,
y=factor(letters[4:8], levels=letters[1:8]),
row.names=letters[4:8])
combine(w, x, y)
# y is converted to 'factor' with different levels[y被转换为不同层次的因素“]
df1 <- data.frame(x=1:5,y=letters[1:5], row.names=letters[1:5])
df2 <- data.frame(z=3:7,y=letters[3:7], row.names=letters[3:7])
try(combine(df1, df2)) # fails[失败]
# solution 1: ensure identical levels[解决方案1:确保相同的水平]
y1 <- factor(letters[1:5], levels=letters[1:7])
y2 <- factor(letters[3:7], levels=letters[1:7])
df1 <- data.frame(x=1:5,y=y1, row.names=letters[1:5])
df2 <- data.frame(z=3:7,y=y2, row.names=letters[3:7])
combine(df1, df2)
# solution 2: force column to be 'character'[解决方案2:力列字符]
df1 <- data.frame(x=1:5,y=I(letters[1:5]), row.names=letters[1:5])
df2 <- data.frame(z=3:7,y=I(letters[3:7]), row.names=letters[3:7])
combine(df1, df2)
m <- matrix(1:20, nrow=5, dimnames=list(LETTERS[1:5], letters[1:4]))
combine(m[1:3,], m[4:5,])
combine(m[1:3, 1:3], m[3:5, 3:4]) # overlap[交叠]
转载请注明:出自 生物统计家园网(http://www.biostatistic.net)。
注:
注1:为了方便大家学习,本文档为生物统计家园网机器人LoveR翻译而成,仅供个人R语言学习参考使用,生物统计家园保留版权。
注2:由于是机器人自动翻译,难免有不准确之处,使用时仔细对照中、英文内容进行反复理解,可以帮助R语言的学习。
注3:如遇到不准确之处,请在本贴的后面进行回帖,我们会逐渐进行修订。
|