On Fri, 2003-09-19 at 15:57, Douglas Bates wrote:
> It may be easier to use the match function which is defined to return
> the index of the first match.
> 
> > corretor <- c(15, 23, 27, 34, 25, 27, 26)
> > match(27, corretor)
> [1] 3


True and presumably much faster as the size of the search vector and the
offset of the first match increases. If this is being done repeatedly,
timing would become important.

Thanks for pointing that out.

Marc

______________________________________________
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help

Reply via email to