Re: [R] lapply or data.table to find a unit's previous transaction

From: Gabor Grothendieck <ggrothendieck_at_gmail.com>
Date: Wed, 02 Jun 2010 23:37:46 -0400

On Wed, Jun 2, 2010 at 10:29 PM, William Rogers <whrogers73_at_gmail.com> wrote:
> I have a dataset of property transactions that includes the
> transaction ID (TranID), property ID (UnitID), and transaction date
> (TranDt). I need to create a data frame (or data table) that includes
> the previous transaction date, if one exists.
> This is an easy problem in SQL, where I just run a sub-query, but I'm
> trying to make R my one-stop-shopping program.  The following code

The sqldf package lets you use SQL queries on R data frames. See its home page at:
http://sqldf.googlecode.com



R-help_at_r-project.org 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. Received on Thu 03 Jun 2010 - 03:40:24 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Thu 03 Jun 2010 - 04:40:27 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.

list of date sections of archive