you would basically change the statement as follows:
aggregate(x$Quantity, list(DayOfYear=x$DayOfYear, Category=x$Category), FUN=sum)
On Sat, Jul 26, 2008 at 2:30 AM, <[EMAIL PROTECTED]> wrote:
> Thank you this is exactly what I wanted.
>
> I was unaware of the 'aggregate' function.
>
> Now what
Thank you this is exactly what I wanted.
I was unaware of the 'aggregate' function.
Now what if I want to know the sum of the sales per day AND per Category? So
for the data below the DayOfYearSales for HOLIDAY and day 1 would be 2.
Thank you.
Kevin
jim holtman <[EMAIL PROTECTED]> wrote:
Is this what you want:
> x
Year DayOfYearSku Quantity CatIdCategory SubCategory
1 2007 1 1000911 10862 HOLIDAYChristmas
2 2007 1 1001381 11160 PET COSTUMES Famous (Licensed)
3 2007 1 1001941 10
I have some data that I read in via read.csv:
sales2007 <- read.csv("Total2007.dat", header=TRUE)
The data looks like:
> sales2007[1:605,]
Year DayOfYearSku Quantity CatId Category SubCategory
1 2007 1 1000911 10862HOLIDAY Christmas
2 20
4 matches
Mail list logo