[R] For the function loc()

David Winsemius dwinsemius at comcast.net
Tue Nov 6 20:40:39 CET 2012


On Nov 6, 2012, at 10:50 AM, Sarah Goslee wrote:

> rseek.org is a good place to start for locating functions.
> 
> We might be better able to help if you'd told us where you got that
> code in the first place.
> 
> On Tue, Nov 6, 2012 at 8:53 AM, yuyaxuan <309772486 at qq.com> wrote:
>> Hello guys,
>> 
>> I am wondering that whether we have the function loc() in R package??? If
>> so, which one should I install?
>> For example, "locrow = loc(row!=0.0)" I met this in the code...I checked the
>> code,, But I didn't find the self defined function..

@yuyaxuan <309772486 at qq.com>

That code looks dangerous. I guessing it was written by an inexperienced R programmer and that 'loc' is a synonym for `which`. You should not be testing or equality of floating point numbers .... read the FAQ.

I searched using findFn in the sos package, and could not find such a function, so my guess is that it was defined in the preceding code that you have not shown.

-- 

David Winsemius, MD
Alameda, CA, USA




More information about the R-help mailing list