s-news
[Top] [All Lists]

Alternative to reShape

To: <s-news@lists.biostat.wustl.edu>
Subject: Alternative to reShape
From: "Bert Jacobs" <b.jacobs@pandora.be>
Date: Tue, 18 Oct 2005 23:43:44 +0200
In-reply-to: AAAAAOXvfE/tUWVMujI1J0cWacvEvSAA
Thread-index: AcXUD56T0kFf+0g1SSqmSWQX/Y/4eAAHDtng
Using S-plus 6.2 for Windows XP

I have a dataframe that looks like this


Col1   Col 2
A      Alt1
A      Alt2
B        Alt2
B        Alt3
B        Alt4
C      Alt1

And I want to rebuild it like

        A       B     C
1       Alt1    Alt2    Alt1
2       Alt2    Alt3    0
3       0       Alt4    0

I've tried the reShape function in the library (Hmisc) but I don't have a
Colvar identifier. It is also unknown hom many alternatives there are but I
think atmost 10 for a category(A,B,C).

Any ideas how to do this?

Thx,
Bert




<Prev in Thread] Current Thread [Next in Thread>