s-news
[Top] [All Lists]

combining lists

To: " s-news (E-mail)" <s-news@lists.biostat.wustl.edu>
Subject: combining lists
From: "Heymans, MW" <mw.heymans@vumc.nl>
Date: Mon, 30 Oct 2006 08:46:48 +0100
Thread-index: Acb7945kDtNTOxKySIeuLieqWrV6iQ==
Thread-topic: combining lists

Dear list,
I have this problem, please your advice.

I have list A that contains two matrix elements:
[[1]]
a b
[1,] 2 1
[2,] 3 2
[3,] 3 2

[[2]]
c d
[1,] 3 5
[2,] 3 1
[3,] 2 3

and list B, that also contains 2 matrices:

[[1]]
e f g
[1,] 1 20 30
[2,] 2 40 50
[3,] 3 60 70
[4,] 4 80 90
[5,] 5 100 110

[[2]]
h i j
[1,] 1 10 20
[2,] 2 20 30
[3,] 3 30 40
[4,] 4 40 50
[5,] 5 50 60

Now I want to match each column of list A with each row of list B in such a way that element 1 of list A corresponds to element 1 of list B (and element 2 of A with 2 of B).

So, in total there will be 4 new matrices, 1 for each column of list A. For example, for column a of list A the new matrix will be:

2 40 50
3 60 70
3 60 70

thanks!
Martijn
VUmc
Amsterdam


<Prev in Thread] Current Thread [Next in Thread>
  • combining lists, Heymans, MW <=