Hello All,
Tried some more Internet searches and came to the conclusion that one probably
does need to create a "timevar" before reshaping from long to wide. Below is
some code that creates the "timevar" and transposes the data.
connection <- textConnection("
005 1 Gemcitabine
005 2 Erlotinib
Erlotinib, Paclitaxel"
instead of "Gemcitabine, Paclitaxel, Erlotinib". That's what I mean when I say
I want the columns in alphabetical order.
Thanks,
Paul
--- On Tue, 3/20/12, R. Michael Weylandt wrote:
> From: R. Michael Weylandt
> Subject: Re: [R] Reshaping data
If I understand you right,
library(reshape2)
dcast(melt(TestData, id.var = "Subject", measure.var = "Drug"), Subject ~ value)
Michael
On Tue, Mar 20, 2012 at 9:50 AM, Paul Miller wrote:
> Hello All,
>
> I was wondering if it's possible to reshape data from long to wide in R
> without using a "
3 matches
Mail list logo