Thanks for the reply. I applied your suggestions on my example and maybe I am missing something but these are alternate ways to create the original table but not the re-arranged table. The data are not stacked by Analyte. I will take a look at the documentation for this library to check whether other code can do it. Rene
-----Original Message----- From: hadley wickham [mailto:[EMAIL PROTECTED] Sent: Thursday, February 15, 2007 11:56 AM To: Rene Braeckman Cc: [email protected] Subject: Re: [R] How to re-arrange data in table? > I like to re-arrange a table (sTable) based on the value of one the > rows > (Analyte) as shown below. Blocks of data with different values for > Analyte need to be stacked below each other. Any easy way to do this > or any advice where to look? How about: library(reshape) dfm <- melt(df, m="AUC") cast(dfm, Analyte + result_variable ~ Dose, myStats) # A few other variations cast(dfm, Analyte ~ Dose ~ result_variable, myStats) cast(dfm, Analyte + Dose ~ result_variable, myStats) # See http://had.co.nz/reshape for more documentation Hadley ______________________________________________ [email protected] mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
