[R] aggregating data with Zoo

2007-03-28 Thread Alfonso Sammassimo
Is there a way of aggregating 'zoo' daily data according to day of week? eg all Thursdays I came across the 'nextfri' function in the documentation but am unsure how to change this so any day of week can be aggregated. I have used POSIX to arrange the data (not as 'zoo' series) according to

Re: [R] aggregating data with Zoo

2007-03-28 Thread Gabor Grothendieck
Please read the last line on every post to r-help. On 3/28/07, Alfonso Sammassimo [EMAIL PROTECTED] wrote: Is there a way of aggregating 'zoo' daily data according to day of week? eg all Thursdays I came across the 'nextfri' function in the documentation but am unsure how to change this so

Re: [R] aggregating data with Zoo

2007-03-28 Thread Achim Zeileis
On Wed, 28 Mar 2007, Alfonso Sammassimo wrote: Is there a way of aggregating 'zoo' daily data according to day of week? eg all Thursdays Sure, the easiest way will probably differ depending on the time stamp class. One example might be this: ## small example with Date index z -

Re: [R] aggregating data with Zoo

2007-03-28 Thread Alfonso Sammassimo
Sent: Thursday, March 29, 2007 1:16 AM Subject: Re: [R] aggregating data with Zoo On Wed, 28 Mar 2007, Alfonso Sammassimo wrote: Is there a way of aggregating 'zoo' daily data according to day of week? eg all Thursdays Sure, the easiest way will probably differ depending on the time stamp

Re: [R] Aggregating data

2006-12-01 Thread Petr Pikal
: David Kaplan [EMAIL PROTECTED] To: r-help@stat.math.ethz.ch Subject:[R] Aggregating data __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read

Re: [R] Aggregating data

2006-11-29 Thread Petr Pikal
:09 -0600 From: David Kaplan [EMAIL PROTECTED] To: r-help@stat.math.ethz.ch Subject:[R] Aggregating data __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help

Re: [R] Aggregating data

2006-11-29 Thread David Kaplan
Kaplan wrote: Date sent:Tue, 28 Nov 2006 22:04:09 -0600 From: David Kaplan [EMAIL PROTECTED] To: r-help@stat.math.ethz.ch Subject: [R] Aggregating data __ R-help@stat.math.ethz.ch mailing

Re: [R] Aggregating data

2006-11-29 Thread David Kaplan
:[R] Aggregating data __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible

Re: [R] Aggregating data

2006-11-29 Thread Gabor Grothendieck
:[R] Aggregating data __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained

Re: [R] Aggregating data

2006-11-29 Thread Gabor Grothendieck
in posting guide. Petr On 28 Nov 2006 at 22:04, David Kaplan wrote: Date sent: Tue, 28 Nov 2006 22:04:09 -0600 From: David Kaplan [EMAIL PROTECTED] To: r-help@stat.math.ethz.ch Subject:[R] Aggregating data

Re: [R] Aggregating data

2006-11-29 Thread Doran, Harold
PROTECTED] On Behalf Of David Kaplan Sent: Wednesday, November 29, 2006 2:16 PM To: Chuck Cleland; r-help@stat.math.ethz.ch Subject: Re: [R] Aggregating data Chuck and others. Here is the problem I need help on. Thanks. I want to follow-up on a question I had a week

Re: [R] Aggregating data

2006-11-29 Thread Chuck Cleland
On 28 Nov 2006 at 22:04, David Kaplan wrote: Date sent: Tue, 28 Nov 2006 22:04:09 -0600 From: David Kaplan [EMAIL PROTECTED] To:r-help@stat.math.ethz.ch Subject: [R] Aggregating data __ R-help

Re: [R] Aggregating data

2006-11-29 Thread Chuck Cleland
:09 -0600 From: David Kaplan [EMAIL PROTECTED] To: r-help@stat.math.ethz.ch Subject: [R] Aggregating data __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read

[R] Aggregating data

2006-11-28 Thread David Kaplan
__ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.

[R] aggregating data and missing values

2005-11-02 Thread Pascal A. Niklaus
Hi all, I would like to aggregate a large data file that is defined by a number of factors and associated values. The point is that not all factor level combinations are present in the data file -- these missing values are in fact to be treated as zeroes. Is there a straightforward way to

Re: [R] aggregating data and missing values

2005-11-02 Thread Gabor Grothendieck
On 11/2/05, Pascal A. Niklaus [EMAIL PROTECTED] wrote: Hi all, I would like to aggregate a large data file that is defined by a number of factors and associated values. The point is that not all factor level combinations are present in the data file -- these missing values are in fact to be

RE: [R] Aggregating data (with more than one function)

2005-04-21 Thread bogdan romocea
I am looking for an answer to a similar question - a generalized solution that would be able to apply (1) any number of functions (2) to any number of vectors (3) by any number of factors (just like SQL's group by). The output data frame must contain the values of the by factors, to be

RE: [R] Aggregating data (with more than one function)

2005-03-29 Thread Robin Schroeder
- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Behalf Of Liaw, Andy Sent: Monday, March 28, 2005 6:45 PM To: 'Sivakumaran Raman'; r-help@stat.math.ethz.ch Subject: RE: [R] Aggregating data (with more than one function) Here's one possible way, using the data you supplied: dat - read.table

RE: [R] Aggregating data (with more than one function)

2005-03-29 Thread Liaw, Andy
University Tempe, Arizona 85287-3211 Phone: (480) 727-7290 -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Behalf Of Liaw, Andy Sent: Monday, March 28, 2005 6:45 PM To: 'Sivakumaran Raman'; r-help@stat.math.ethz.ch Subject: RE: [R] Aggregating data

[R] Aggregating data (with more than one function)

2005-03-28 Thread Sivakumaran Raman
I have the data similar to the following in a data frame: LastName Department Salary 1 JohnsonIT 56000 2 James HR 54223 3 Howe Finance 8 4 Jones Finance 82000 5 NorwoodIT 67000 6 Benson Sales 76000 7 Smith

RE: [R] Aggregating data (with more than one function)

2005-03-28 Thread Liaw, Andy
Here's one possible way, using the data you supplied: dat - read.table(clipboard, header=T, row=1) do.call(rbind,by(dat$Salary, dat$Department, function(x) c(mean=mean(x), total=sum(x mean total Finance 83925.67 251777 HR 6.33 19 IT 59928.67 179786 Sales

Re: [R] Aggregating data (with more than one function)

2005-03-28 Thread Marc Schwartz
On Mon, 2005-03-28 at 19:15 -0600, Sivakumaran Raman wrote: I have the data similar to the following in a data frame: LastName Department Salary 1 JohnsonIT 56000 2 James HR 54223 3 Howe Finance 8 4 Jones Finance 82000 5

Re: [R] Aggregating data (with more than one function)

2005-03-28 Thread Adaikalavan Ramasamy
In the Arguments section of help(aggregate), you will find : FUN: a scalar function to compute the summary statistics which can be applied to all data subsets. a) So you can try the 'by' function : by( df[ , 3], df$Department, function(x) c(mean(x), sum(x)) ) INDICES: Finance