Re: [R] elementwise matrix multiplication with a special structure

2015-10-26 Thread eugen pircalabelu via R-help
ise matrix multiplication with a special structure Don't use html formatted emails. The r-help server strips the html formatting leaving us the the mess you see below. You don't need any loops: > aa <- matrix(1:9, 3, 3) > bb <- aa * 10 > cc <- bb * 10 > x <- as.matrix(ex

Re: [R] elementwise matrix multiplication with a special structure

2015-10-23 Thread David L Carlson
Don't use html formatted emails. The r-help server strips the html formatting leaving us the the mess you see below. You don't need any loops: > aa <- matrix(1:9, 3, 3) > bb <- aa * 10 > cc <- bb * 10 > x <- as.matrix(expand.grid(k=1:3, j=1:3, c=1:3, r=1:3)) > str(x) int [1:81, 1:4] 1 2 3 1 2