On Nov 8, 2012, at 9:51 AM, Geophagus wrote: > Hi @ all, > I hope for some help of you. > I have a dataframe and I want to regroup it. > examp4.csv <http://r.789695.n4.nabble.com/file/n4648927/examp4.csv>
Sigh. Please expalin why you posted a link to a "csv file" that had no commas. > > I need the arguments of "VAL" as table heads and the "TYPE " only in > individual expression. > The result should look like in the example pic. > > exp4.png <http://r.789695.n4.nabble.com/file/n4648927/exp4.png> > > I think reshape can do it? Perhaps, but since you only have one value per cross-category, why not: xtabs(AMOUNT ~ TYPE+VAL, data=t1) OR: tapply(t1$AMOUNT, list(t1$TYPE, t1$VAL), c) -- David Winsemius, MD Alameda, CA, USA ______________________________________________ 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.