[R] Regrouping dataframe

arun smartpink111 at yahoo.com
Thu Nov 8 22:27:10 CET 2012


Hi,
No problem.

Another method will be:
library(reshape2)
dcast(dat1,TYPE~VAL,value.var="AMOUNT")
#    TYPE BB BE  BK  BW BZ HH HR MN  MT  NK  RR SL SM SN SZ UU
#1 WASTE1 82 19 254 167 14 33 93 48 144 359 112 27 62 59 86 51
#2 WASTE2 11  2  60  46 NA 13 54  6  48 159  19  2 16 16 59  9
#3 WASTE3 15 16  33  23  5  3 15  4  27  72   5  9  6 16 20 10
A.K.



----- Original Message -----
From: Geophagus <fh at retposto.net>
To: r-help at r-project.org
Cc: 
Sent: Thursday, November 8, 2012 3:04 PM
Subject: Re: [R] Regrouping dataframe

Thank you very much!
It works !

Best greetings
GeO




--
View this message in context: http://r.789695.n4.nabble.com/Regrouping-dataframe-tp4648927p4648956.html
Sent from the R help mailing list archive at Nabble.com.

______________________________________________
R-help at 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.





More information about the R-help mailing list