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
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
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 -
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
: 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
: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
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
:[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
:[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
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
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
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
: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-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.
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
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
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
-
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
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
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
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
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
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
23 matches
Mail list logo