Re: [R] comparing with lead function

2008-10-15 Thread hadley wickham
On Wed, Oct 15, 2008 at 5:59 AM, Michael Pearmain <[EMAIL PROTECTED]> wrote: > Hi All, > I've been trying to compare if the previous value in a variable is equal to > a binary value..(i.e i want to check if the last event was a yes or no) > > i've been trying to write some code for this, but it see

[R] comparing with lead function

2008-10-15 Thread Michael Pearmain
Hi All, I've been trying to compare if the previous value in a variable is equal to a binary value..(i.e i want to check if the last event was a yes or no) i've been trying to write some code for this, but it seems overly elaborate, can anyone suggest a better / shorter / neater way? The below doe