Re: [R] NAs - NAs are not allowed in subscripted assignments

From: Gabor Csardi <csardi_at_rmki.kfki.hu>
Date: Thu, 24 Jul 2008 14:01:04 -0500

On Thu, Jul 24, 2008 at 10:39:34AM -0700, Nordlund, Dan (DSHS/RDA) wrote: [...]
> Yes, it does help. I was misunderstanding how logical values are
> used for indexing. I assumed incorrectly that a value would be
> returned only if the index expression evaluated as TRUE. It would
> seem that the philosophy is that not returning a value would imply
> that the expression evaluated to FALSE. So, indexing with NA must
> return something, and NA is the appropriate value to return since one
> doesn't know what it is.
>
> Is that a reasonable summary?

Yes, I think so. (But I have to say that I'm not completely aware of the ideology behind this choice.)

Gabor

> Dan
>
> Daniel J. Nordlund
> Washington State Department of Social and Health Services
> Planning, Performance, and Accountability
> Research and Data Analysis Division
> Olympia, WA 98504-5204
>
>
>

-- 
Csardi Gabor <csardi_at_rmki.kfki.hu>    UNIL DGM

______________________________________________
R-help_at_r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
Received on Thu 24 Jul 2008 - 19:09:46 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Thu 24 Jul 2008 - 19:32:25 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.

list of date sections of archive