作者bcs (= ="frailty..gggg XD)
看板D95323XXX
标题[计量] R的element wise multiplication?
时间Wed Jun 20 23:23:22 2007
经过刚好看到板上有讨论R
想请问在R中element wise的相乘符号是?
在Gauss,Ox都能跑,但在R好像不能支援non-conformable
OX :
#include<oxstd.h>
main(){
decl a, b, c;
a=<2,1>;
b=<2,1;3,4;4,6>;
c=a.*b;
print(a,b,c);
}
R: warnning!
a<-matrix(c(2,1),1,2)
b<-matrix(c(2,1,3,4,4,6),3,2)
c<-a*b
a*b : non-conformable arrays
试了outer / inner product 都失败。
麻烦各位,谢谢:>
--
※ 发信站: 批踢踢实业坊(ptt.cc)
◆ From: 140.112.247.214