Displaying 2 results from an estimated 2 matches for "t2007".
Did you mean:
2007
2008 Aug 09
1
Reshape set operations?
I have mange to use the library reshape to give me data structures that I want. Specifically:
m2008 <- melt(t2008, id.var=c("DayOfYear","Category","SubCategory","Sku"), measure.var=c("Quantity"))
m2007 <- melt(t2007, id.var=c("DayOfYear","Category","SubCategory","Sku"), measure.var=c("Quantity"))
r2008 <- cast(m2008, DayOfYear ~ variable | Sku, sum)
r2007 <- cast(m2007, DayOfYear ~ variable | Sku, sum)
Now I would like to union the two lists. So I sta...
2008 Aug 05
1
RESHAPE cast help.
...SKS Wigs - Women's
4 2007 1 100432 1 10865 HOLIDAY Easter
5 2007 1 100911 1 10120 MEN Superheroes Men
So I have the following to help me summarize the data by the various columns:
library("reshape")
t <- melt(t2007, id.var=c("DayOfYear","Category","SubCategory","Sku"), measure.var=c("Quantity"))
The following seems to give me the sales for each day of the year:
head(cast(t, DayOfYear ~ variable, sum))
DayOfYear Quantity
1 1 861
2 2...