[tech-spec] R Gedankenexperiment

  • From: Steve Wisdom <swisdom@xxxxxxxxx>
  • To: tech-spec@xxxxxxxxxxxxx
  • Date: Tue, 5 Oct 2004 15:17:06 -0400

Something that comes up often in my R fiddling, and that I haven't
settled on a 'best practice' for, is 'get the next X [from vector A]
after Y [from vector B]'

Idea is to mesh trade 'entries' from A and 'exits' from B  

A reworked tidbit from one of Tom's programs, with apologies to him: 

exit <- unlist( sapply( entry, function(x) min( which( event> x))))
 
And I've independently found myself writing very similar lines
[although 'anonymous functions' are against my religion, but that's a
matter of style]

But is there a better way?  Anyone up for a Gedankenexperiment? 

Thanks, SW

Other related posts: