Re: [R] Multiplying elements of vectors

2011-02-06 Thread Mariana Martinez-Morales
Super Phil!! Thank you very much!! Mariana On Sat, Feb 5, 2011 at 8:54 PM, Phil Spector wrote: > If the seq(5,205) was a typo, and should have been > seq(5,20,5), then what you're looking for is the outer > product of x and y: > >> x = seq(5,20,5) >> y = seq(5,20,5) >> x %o% y > >     [,1] [,2]

Re: [R] Multiplying elements of vectors

2011-02-05 Thread Phil Spector
If the seq(5,205) was a typo, and should have been seq(5,20,5), then what you're looking for is the outer product of x and y: x = seq(5,20,5) y = seq(5,20,5) x %o% y [,1] [,2] [,3] [,4] [1,] 25 50 75 100 [2,] 50 100 150 200 [3,] 75 150 225 300 [4,] 100 200 300 400 out

[R] Multiplying elements of vectors

2011-02-05 Thread Mariana Martinez-Morales
Hi guys: Sorry if this question is very basic. I’m learning basic matrix and vectors multiplication to develop a population matrix model for plants. I’m trying to multiply the elements of two vectors (each of the “x” values by each of the “y” values) to obtain a square matrix of xy values. f.e. x

Re: [R] Multiplying elements of vectors

2011-02-05 Thread Mariana Martinez-Morales
Sorry I just sent a message, but I forgot to say thanks for any suggestion and help!! Mariana __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html