Re: [R] comparing fields within a record

2011-12-27 Thread Jorge I Velez
Try also subset(x, as.Date(Inspected, %m/%d/%y) as.Date(Sold, %m/%d/%y) ) HTH, Jorge.- On Mon, Dec 26, 2011 at 9:32 PM, Jorge I Velez wrote: Hi Eric, Try # data x - structure(list(House_number = 1:4, Inspected = structure(c(3L, 4L, 1L, 2L), .Label = c(10/31/2011, 8/3/2011, 9/2/2011,

Re: [R] comparing fields within a record

2011-12-27 Thread Eric Wolff
I should have said, those date vairable are indeed date variables, but I'll try some of these techniques as soon as I get in this morning. Thanks so much for your input. - Eric On Tue, Dec 27, 2011 at 6:54 AM, Jorge I Velez jorgeivanve...@gmail.comwrote: Try also subset(x,

[R] comparing fields within a record

2011-12-26 Thread Eric Wolff
Hi, I hope this isn't a really simple question, I've been struggling with it for a while. I'm looking for a way to get a function to go through a data frame line by line, compare fields, and produce a result, kind of a transform and an if statement combined (I tried to put them together and it

Re: [R] comparing fields within a record

2011-12-26 Thread Jorge I Velez
Hi Eric, Try # data x - structure(list(House_number = 1:4, Inspected = structure(c(3L, 4L, 1L, 2L), .Label = c(10/31/2011, 8/3/2011, 9/2/2011, 9/4/2011), class = factor), Sold = structure(c(1L, 2L, 4L, 3L), .Label = c(10/10/2011, 10/20/2011, 11/1/2011, 8/28/2011 ), class = factor)), .Names =

Re: [R] comparing fields within a record

2011-12-26 Thread David Winsemius
On Dec 26, 2011, at 7:52 PM, Eric Wolff wrote: Hi, I hope this isn't a really simple question, I've been struggling with it for a while. I'm looking for a way to get a function to go through a data frame line by line, compare fields, and produce a result, kind of a transform and an if