Re: [R] Simple vector question.

2008-07-26 Thread jim holtman
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

Re: [R] Simple vector question.

2008-07-25 Thread rkevinburton
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:

Re: [R] Simple vector question.

2008-07-25 Thread jim holtman
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

[R] Simple vector question.

2008-07-25 Thread rkevinburton
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