outer(base)
outer()所属R语言包:base
Outer Product of Arrays
外的阵列产品
译者:生物统计家园网 机器人LoveR
描述----------Description----------
The outer product of the arrays X and Y is the array A with dimension c(dim(X), dim(Y)) where element A[c(arrayindex.x, arrayindex.y)] = FUN(X[arrayindex.x], Y[arrayindex.y], ...).
外产品阵列X和Y是数组A维c(dim(X), dim(Y))那里元素A[c(arrayindex.x, arrayindex.y)] = FUN(X[arrayindex.x], Y[arrayindex.y], ...)。
用法----------Usage----------
outer(X, Y, FUN="*", ...)
X %o% Y
参数----------Arguments----------
参数:X, Y
First and second arguments for function FUN. Typically a vector or array.
第一和第二个参数,功能FUN。通常一个向量或数组。
参数:FUN
a function to use on the outer products, found via match.fun (except for the special case "*").
通过match.fun(除特殊情况"*")外的产品,使用功能。
参数:...
optional arguments to be passed to FUN.
可选参数被传递到FUN。
Details
详情----------Details----------
X and Y must be suitable arguments for FUN. Each will be extended by rep to length the products of the lengths of X and Y before FUN is called.
X和Y必须FUN的合适的参数。 rep长度X和Y前FUN被称为长度的产品都将延长。
FUN is called with these two extended vectors as arguments. Therefore, it must be a vectorized function (or the name of one), expecting at least two arguments.
FUN被称为作为参数的扩展与这两个向量。因此,它必须是一个矢量函数(或一个名字),预计至少有两个参数。
Where they exist, the [dim]names of X and Y will be copied to the answer, and a dimension assigned which is the concatenation of the dimensions of X and Y (or lengths if dimensions do not exist).
他们的存在,[暗淡]名称XY将被复制到了答案,这是的X和Y尺寸串连维度分配的(或如果尺寸不存在的长度)。
FUN = "*" is handled internally as a special case, via as.vector(X) %*% t(as.vector(Y)), and is intended only for numeric vectors and arrays.
FUN = "*"内部处理作为一种特殊的情况下,通过as.vector(X) %*% t(as.vector(Y)),仅用于数字向量和数组。
%o% is binary operator providing a wrapper for outer(x, y, "*").
%o%是二进制运营商提供了一个outer(x, y, "*")的包装。
作者(S)----------Author(s)----------
Jonathan Rougier
参考文献----------References----------
The New S Language. Wadsworth & Brooks/Cole.
参见----------See Also----------
%*% for usual (inner) matrix vector multiplication; kronecker which is based on outer; Vectorize for vectorizing a non-vectorized function.
%*%通常(内部)矩阵向量乘法;kronecker这是基于对outer;Vectorize矢量非矢量化功能。
举例----------Examples----------
x <- 1:9; names(x) <- x
# Multiplication & Power Tables[乘法和功率表]
x %o% x
y <- 2:8; names(y) <- paste(y,":",sep="")
outer(y, x, "^")
outer(month.abb, 1999:2003, FUN = "paste")
## three way multiplication table:[#三通乘法表:]
x %o% x %o% y[1:3]
转载请注明:出自 生物统计家园网(http://www.biostatistic.net)。
注:
注1:为了方便大家学习,本文档为生物统计家园网机器人LoveR翻译而成,仅供个人R语言学习参考使用,生物统计家园保留版权。
注2:由于是机器人自动翻译,难免有不准确之处,使用时仔细对照中、英文内容进行反复理解,可以帮助R语言的学习。
注3:如遇到不准确之处,请在本贴的后面进行回帖,我们会逐渐进行修订。
|