[R] Lagged values problem requiring short solution time

Rui Barradas ruipbarradas at sapo.pt
Mon Dec 12 19:49:15 CET 2011


I'm sorry, but my code has a bug
The correction is:

1) delete the two lines with 'ix'
2) replace them with

	for(i in 2:n)
		if(abs(x[i] - x[i-1]) < delta) x[i] <- x[i-1] + delta

That's it. The problem is that it's back to slowness.

Sorry, once again,

Rui Barradas

View this message in context: http://r.789695.n4.nabble.com/Lagged-values-problem-requiring-short-solution-time-tp4184566p4187126.html
Sent from the R help mailing list archive at Nabble.com.

More information about the R-help mailing list