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
>
>
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
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
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
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]>
&
education.wisc.edu/edpsych/facstaff/kaplan/kaplan.htm
>>>> Phone: 608-262-0836
>>>> ===========
>>>>
>>>> Petr Pikal wrote:
>>>>> Similar answer as last time
>>>>>
>>
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
> [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.
>
>
>
MAIL PROTECTED]
> > >> homepage:
> > >> http://www.education.wisc.edu/edpsych/facstaff/kaplan/kaplan.htm
> > >> Phone: 608-262-0836
> > >> =======
> &
> >>
> >> Petr Pikal wrote:
> >>> Similar answer as last time
> >>>
> >>> aggregate, tapply, by or ppackage doBy
> >>>
> >>> HTH
> >>>
> >>> PS. If you want to add some
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
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
: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-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.
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
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
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
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 &
>
>
-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
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
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
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
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
23 matches
Mail list logo