[R] summation coding

djbanana karl79264219 at gmail.com
Thu Oct 18 21:33:39 CEST 2012

I would like to code the following in R: a1(b1+b2+b3) + a2(b1+b3+b4) +
a3(b1+b2+b4) + a4(b1+b2+b3)

or in summation notation: sum_{i=1, j\neq i}^{4} a_i * b_i

I realise this is the same as: sum_{i=1, j=1}^{4} a_i * b_i - sum_{i=j} a_i
* b_i

would appreciate some help.

Thank you.

View this message in context: http://r.789695.n4.nabble.com/summation-coding-tp4646678.html
Sent from the R help mailing list archive at Nabble.com.

More information about the R-help mailing list