Thank you very much! I really liked the first solution, it worked great for
my larger dataset.
M
Gabor Grothendieck wrote:
>
> On Fri, Jun 3, 2011 at 8:11 AM, mdvaan
> wrote:
>> Would it be possible to use the sqldf package and the ave function to
>> simply
>> run ave
On Fri, Jun 3, 2011 at 8:11 AM, mdvaan wrote:
> Would it be possible to use the sqldf package and the ave function to simply
> run ave over a limited set? So something like:
>
> DF = data.frame(read.table(textConnection(" A B
> 8025 1995
> 8026 1995
> 8029 1995
> 8026 1996
> 8025 1997
> 802
On Thu, Jun 2, 2011 at 11:41 AM, mdvaan wrote:
> Hi list, based on the following data.frame I would like to create a variable
> that indicates the number of occurrences of A in the 3 years prior to the
> current year:
>
> DF = data.frame(read.table(textConnection(" A B
> 8025 1995
> 8026 1995
Would it be possible to use the sqldf package and the ave function to simply
run ave over a limited set? So something like:
DF = data.frame(read.table(textConnection(" A B
8025 1995
8026 1995
8029 1995
8026 1996
8025 1997
8026 1997
8025 1997
8027 1997
8026 1999
8027 1999
802
Hi list, based on the following data.frame I would like to create a variable
that indicates the number of occurrences of A in the 3 years prior to the
current year:
DF = data.frame(read.table(textConnection(" A B
8025 1995
8026 1995
8029 1995
8026 1996
8025 1997
8026 1997
8025 1997
8027
5 matches
Mail list logo