?outer
> v1 <- c(20,40,20,60)
> v2 <- c(5,4,2)
> outer(v1,v2,'/')
     [,1] [,2] [,3]
[1,]    4    5   10
[2,]    8   10   20
[3,]    4    5   10
[4,]   12   15   30
>



On 5/26/06, Andrej Kastrin <andrej.kastrin@siol.net> wrote:
>
> Dear useRs,
>
> I have two different length vectors: one column (1...m) and one row
> vector (1...n):
>
> 20
> 40
> 20
> 60
>
> 5 4 2
>
> Now I have to calculate ratios between column vector elements and each
> row vector elements:
>
> 4 5 10
> 8 10 20
> 4 5 20
> 15 12 30
>
> Thank's in advance for any suggestions,
>
> Andrej
>
> ______________________________________________
> R-help@stat.math.ethz.ch mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide!
> http://www.R-project.org/posting-guide.html
>



-- 
Jim Holtman
Cincinnati, OH
+1 513 646 9390 (Cell)
+1 513 247 0281 (Home)

What is the problem you are trying to solve?

	[[alternative HTML version deleted]]

