Skip to content
Prev 166685 / 398502 Next

How to reference previous row?

Hello,

The solution to problem will seem far easier if you think in a different
way. For instance, you may want to consider the extra dummy column

previous.first.value <- c( "NA", first[ - length(first) ] )

Then you can "horizontally" compare first with it's previous value.

Best regards,

Carlos J. Gil Bellosta
http://www.datanalytics.com
On Mon, 2009-01-12 at 18:57 +1100, Heston Capital wrote: