rkevinburtoncharternet thank help let really show ignorance iterate data frame help list like headc dayofyear category quantity 1 1 unknown 82 2 1 7 plates dessert 4 3 1 7 plates dessert 18 4 1 9 plates dinner 10 5 1 9 plates dinner 8 6 1 accessories makeup 127 want form another data frame category unknown want dataframe like dayofyear quantity 1 82 2 80 3 16 quantity obviously quantity unknown category day year give ignorance tried cunknown ccategoryunknown etc dont seem work something dont understand structure passed back cast thanks kevin hadley wickham wrote tue aug 5 2008 1159 wrote set data basically sales figures given year columns yeaqr day year sku subcatetory category first lines data look like year dayofyear sku quantity catid category subcategory 1 2007 1 100091 1 10862 holiday christmas 2 2007 1 100138 1 11160 pet costumes famous licensed 3 2007 1 100194 1 10749 hats wigs masks wigs womens 4 2007 1 100432 1 10865 holiday easter 5 2007 1 100911 1 10120 men superheroes men following help summarize data various columns libraryreshape meltt2007 idvarcdayofyearcategorysubcategorysku measurevarcquantity following seems give sales day year headcastt dayofyear variable sum dayofyear quantity 1 1 861 2 2 1732 3 3 2124 4 4 1801 5 5 2147 6 6 1312 want get sales day year category following doesnt seem right headcastt dayofyear category variable sum 1 na 2 na na 2 na look castt dayofyear category variable sum 3d array probably want probably want castt dayofyear category variable sum id suggest reading introduction reshape pdf hadley httphadconz ______________________________________________ rhelprprojectorg mailing list httpsstatethzchmailmanlistinforhelp please read posting guide httpwwwrprojectorgpostingguidehtml provide commented minimal selfcontained reproducible code wed 06 aug 2008 032252 0400 r reshape cast help