Re: [R] help for reshape function

From: Andrie de Vries <>
Date: Fri, 18 Jun 2010 03:37:59 -0700 (PDT)

Xin Wei

I have sympathy with your difficulties in understanding the reshape() function.

May I recommend using the melt() and cast() functions instead, available in the reshape package. You can find information, help and examples here:

This simplifies the coding of your problem dramatically:


df <- data.frame(gene=c("gene1", "gene2", "gene3"),


melt(df, id.vars="gene")



View this message in context:
Sent from the R help mailing list archive at

______________________________________________ mailing list
PLEASE do read the posting guide
and provide commented, minimal, self-contained, reproducible code.
Received on Fri 18 Jun 2010 - 12:09:45 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Fri 18 Jun 2010 - 12:20:33 GMT.

Mailing list information is available at Please read the posting guide before posting to the list.

list of date sections of archive