[R] Basic vector operations was: Function to approximate complex integral

Sebastian Luque spluque at gmail.com
Wed Apr 19 21:43:02 CEST 2006


"Doran, Harold" <HDoran at air.org> wrote:

[...]

> a <- c(2,3)
> b <- c(4,5,6)

> (2*4) + (2*5) + (2*6) + (3*4) + (3*5) +(3*6)

> But I do not know of a built in function that would do this. Any
> suggestions?

How about:

sum(a %o% b)

?%o%

Cheers,

-- 
Seb




More information about the R-help mailing list