Re: [R] aggregating data with Zoo

2007-03-28 Thread Alfonso Sammassimo
OTECTED]> Cc: 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 > >

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 <- read.z

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 thi

[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 day

Re: [R] Aggregating data

2006-12-01 Thread Petr Pikal
t use HTML posting as recommended 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]> &

Re: [R] Aggregating data

2006-11-29 Thread Chuck Cleland
education.wisc.edu/edpsych/facstaff/kaplan/kaplan.htm >>>> Phone: 608-262-0836 >>>> =========== >>>> >>>> Petr Pikal wrote: >>>>> Similar answer as last time >>>>> >>

Re: [R] Aggregating data

2006-11-29 Thread Chuck Cleland
rote: >>>> Similar answer as last time >>>> >>>> aggregate, tapply, by or ppackage doBy >>>> >>>> HTH >>>> >>>> PS. If you want to add some other text then subject in your post do >>>> not use HTML posting as recommend

Re: [R] Aggregating data

2006-11-29 Thread Doran, Harold
> [mailto:[EMAIL 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. > > >

Re: [R] Aggregating data

2006-11-29 Thread Gabor Grothendieck
MAIL PROTECTED] > > >> homepage: > > >> http://www.education.wisc.edu/edpsych/facstaff/kaplan/kaplan.htm > > >> Phone: 608-262-0836 > > >> ======= > &

Re: [R] Aggregating data

2006-11-29 Thread Gabor Grothendieck
> >> > >> Petr Pikal wrote: > >>> Similar answer as last time > >>> > >>> aggregate, tapply, by or ppackage doBy > >>> > >>> HTH > >>> > >>> PS. If you want to add some

Re: [R] Aggregating data

2006-11-29 Thread David Kaplan
you want to add some other text then subject in your post do >>> not use HTML posting as recommended in posting guide. >>> >>> Petr >>> >>> >>> On 28 Nov 2006 at 22:04, David Kaplan wrote: >>> >>> Date sent: Tue, 28 Nov 2006

Re: [R] Aggregating data

2006-11-29 Thread David Kaplan
gt; > 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] Aggregati

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/mailm

[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.

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 > f

[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 (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 u

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

2005-03-29 Thread Liaw, Andy
TECTED] 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 &

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

2005-03-29 Thread Robin Schroeder
> > -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 (with more than one function) Here's one possib

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

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 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

[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