On Wed, Jun 2, 2010 at 10:29 PM, William Rogers <whroger...@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@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.