From MSchwartz at mn.rr.com  Thu Oct 20 14:58:24 2005
From: MSchwartz at mn.rr.com (Marc Schwartz)
Date: Thu, 20 Oct 2005 07:58:24 -0500
Subject: [Rd] is.na<- problem
In-Reply-To: <17239.25754.59979.321531@stat.math.ethz.ch>
References: <XFMail.051020011342.Ted.Harding@nessie.mcc.ac.uk>
	<1129769164.5955.5.camel@localhost.localdomain>
	<971536df0510191809v3a7cd3d0k753e95a71be027d3@mail.gmail.com>
	<1129771685.5955.12.camel@localhost.localdomain>
	<17239.25754.59979.321531@stat.math.ethz.ch>
Message-ID: <1129813104.8394.1.camel@localhost.localdomain>

On Thu, 2005-10-20 at 11:34 +0200, Martin Maechler wrote:
> >>>>> "Marc" == Marc Schwartz <MSchwartz at mn.rr.com>
> >>>>>     on Wed, 19 Oct 2005 20:28:05 -0500 writes:
>    .............
> 
>     >> > In reviewing the Green Book on the top of page 143, it shows an example
>     >> > in which the RHS of the assignment are the indices into the LHS object
>     >> > which are to be set to NA. For example:
>     >> >
>     >> > > xx <- c(0:5)
>     >> >
>     >> > > xx
>     >> > [1] 0 1 2 3 4 5
>     >> >
>     >> > > is.na(xx) <- c(3, 4)
>     >> >
>     >> > > xx
>     >> > [1]  0  1 NA NA  4  5
>     >> >
>     >> >
> 
>    ...........
> 
>     Marc> In all honesty, while I understood the concept from reading the help
>     Marc> page, it was not truly clear until I read the Green Book and saw the
>     Marc> example as to how to actually use the function.
> 
>     Marc> It would probably be worthwhile to add an example of use to the help
>     Marc> page.
> 
> good idea. I've added a version of yours:
> 
> (xx <- c(0:4))
> is.na(xx) <- c(2, 4)
> xx                     #> 0 NA  2 NA  4
> 
> Martin

Great!

Thanks Martin!

Marc



[Rd] is.na<- problem
Marc Schwartz