s-news
[Top] [All Lists]

Re: group by

To: "Neung-Hwan Oh" <ultisol@gmail.com>
Subject: Re: group by
From: "Wensui Liu" <liuwensui@gmail.com>
Date: Wed, 14 Mar 2007 17:02:26 -0400
Cc: s-news@wubios.wustl.edu
Dkim-signature: a=rsa-sha1; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=TAK083wxY3NnIKmvbl+hjmZXYRKgY0X2MSD/xBfCOcwYYSlkjH9JeSt9/iD34DnVL76BhEdLbRrV7BjALteSJRtfRsC1jxQqE4YTUokfEqEKCBmRtv0oEwrW2/4fIHAWFgKNODsu9kZM/zsZdPuawuUIjfbQaDr3YFyL74oid2M=
Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=K/ir6QL8ne3ne612JmSsNtqsoKN59D0rPyo8reOnN1jkDG3vzDEUKqNnMUoF+E5P2RfWEWC1ChN0k8yV7dj2W6E8jIlAEdUAfqxjhFvcNt/9ReT+PSP/gdHhQqycnF+S2GxZnD/nxGZyAx/i+pFhZLms6eU9SxXd60WyyvvhNWw=
In-reply-to: <67249fb50703141348g56ff34d6r84df58ffc49738ab@mail.gmail.com>
References: <67249fb50703141348g56ff34d6r84df58ffc49738ab@mail.gmail.com>
I am not sure if in Splus, there is a nice function like tapply() in R or not.

On 3/14/07, Neung-Hwan Oh <ultisol@gmail.com> wrote:
Hello,

How can you calculate the following example in s-plus?   In Access, it is
relatively easy with "Group By" and I am wondering whether there is a
similar function that I missed in S-Plus.



"From this table"

site.no date time value

1 1989/04/27 12:00   1.0

2 1975/10/01 19:00   2.0

2 1975/10/01 20:00   4.0

3 1993/04/10 09:00   3.0

3 1993/04/10 12:00   6.0

3 1993/04/10 15:00   9.0



"To this (averages per date per site)" + (count column?)

1 1989/04/27 12:00 1.0  (1.0)

2 1975/10/01 19:30 3.0  (2.0)

3 1993/04/10 12:00 6.0  (3.0)



Many thanks!

NH


--
WenSui Liu
A lousy statistician who happens to know a little programming
(http://spaces.msn.com/statcompute/blog)

<Prev in Thread] Current Thread [Next in Thread>