[R] different functions on different vector subsets

Thomas Lumley tlumley at u.washington.edu
Thu Nov 10 22:03:23 CET 2005


On Thu, 10 Nov 2005, Thomas Lumley wrote:

> On Thu, 10 Nov 2005, Ron Ophir wrote:
>
>> Thanks Thomas,
>> 
>> "...For logical subscripts you could argue that the
>> ambiguity isn't present and that if the index was NA the element should
>> just be set to NA. This change might be worth making."
>> 
>> I see you got my point. NA should return NA no matter what the
>> comparison is.
>
> I'm not sure that I did get your point.  As Brian said, you aren't specifying 
> whether or not to set the value. In your example it didn't matter because it 
> would end up NA either way.
>

And as Brian later pointed out, this approach wouldn't work for things 
other than simple vectors.

 	-thomas




More information about the R-help mailing list