Skip to content
Prev 310312 / 398506 Next

Regrouping dataframe

On Nov 8, 2012, at 9:51 AM, Geophagus wrote:

            
Sigh. Please expalin why you posted a link to a "csv file" that had no commas.
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)