Re: [R] aggregate function not working?

2012-10-18 Thread arun
- From: jcrosbie ja...@crosb.ie To: r-help@r-project.org Cc: Sent: Wednesday, October 17, 2012 4:45 PM Subject: [R] aggregate function not working? The aggregate function for some reason will now work for me. The error I'm getting is: Error in sort.list(y) : 'x' must be atomic for 'sort.list

[R] aggregate function not working?

2012-10-17 Thread jcrosbie
The aggregate function for some reason will now work for me. The error I'm getting is: Error in sort.list(y) : 'x' must be atomic for 'sort.list' Have you called 'sort' on a list? agPriceList=aggregate(PriceList$Size, list(PriceList$bandNum),sum) *Price list dataframe:* dput(PriceList)

Re: [R] aggregate function not working?

2012-10-17 Thread Sarah Goslee
If you read the error message carefully and look at the data you included with dput() (for which I thank you!), you'll see that bandNum is a list, not a vector, just as the error message told you. I'm not sure how you created or imported your data frame, but something appears to have not worked

Re: [R] aggregate function not working?

2012-10-17 Thread David Winsemius
On Oct 17, 2012, at 1:45 PM, jcrosbie wrote: The aggregate function for some reason will now work for me. The error I'm getting is: Error in sort.list(y) : 'x' must be atomic for 'sort.list' Have you called 'sort' on a list? You have managed to create a slightly pathological dataframe: