On 21/08/11 03:04, Wendy wrote:
Hi all,
I have a data.frame like following
A<-c('d0','d0','d1','d1','d2','d2')
B<-rep(c('control','sample'),3)
C<-c(rep(100000,2),200,300,400,500)
dataframe<-data.frame(A,B,C)
I want to reshape the matrix, so the matrix with 'd0', 'd1' and 'd2' in rows
and 'control' and 'sample' in columns. Is there a function for doing this
easily?
Your question has been answered .... But if you remember that a *matrix*
and a *data frame* are ***NOT*** the same thing, you'll get into a lot less
trouble. Why do you think there are two *different* terms for these sorts
of object if they are the same thing? Psigh!!!
cheers,
Rolf Turner
______________________________________________
R-help@r-project.org 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.