Skip to content
Back to formatted view

Raw Message

Message-ID: <1312304456.51386.YahooMailNeo@web121802.mail.ne1.yahoo.com>
Date: 2011-08-02T17:00:56Z
From: Jagz Bell
Subject: Data frame to matrix  - revisited

Hi,
I've tried to look through all the previous related Threads/posts but can't find a solution to what's probably a simple question.
?
I have a data frame comprised of three columns e.g.:
?
ID1?ID2?Value
a?b?1
b?d?1
c?a?2
c?e?1
d?a?1
e?d?2
?
I'd like to convert the data to a matrix i.e.:
?
?a b c d e
a n/a 1 2 1 n/a
b 1 n/a n/a 1 n/a?
c 2 n/a n/a n/a 1
d 1 1 n/a n/a 2
e n/a n/a 1 2 n/a
?
Any help is much appreciated,
?
Jagz