Skip to content
Back to formatted view

Raw Message

Message-ID: <A0C20390AF37844A9E2C783C9C268D8C496566EEB4@CCD1XM1101.ccd1.root4.net>
Date: 2011-10-05T16:11:18Z
From: fernando.cabrera at nordea.com
Subject: Populate a matrix

Hi guys

I have vectors x <- c(1,2,3,4) and y <- c(4,3,9) and would like to generate a matrix which has 3 rows (length(y)) and 4 columns (length(x)), and each row is the corresponding y element repeated length(x) times.

4,4,4,4
3,3,3,3
9,9,9,9

Thanks.

Fernando ?lvarez