[R] an issue about removing "NA"s from an array

Bert Gunter
2013-06-21T16:13:51Z

You really really need to do your homework.

?NA

-- Bert

On Fri, Jun 21, 2013 at 8:59 AM, Yasin Gocgun <entropy053 at gmail.com>
wrote:
> Hi,*
>
> *I would like to set the entries of an array that appear as "NA"
to a
> certain integer, but did not find a way to do so. The related code is given
> below:
>
> A <- array(-1000 , dim=c(100) );
>
> for(i in 1: 100 ){
>      A[i] =B[i,57] -  B[i,5];
> }
>
> A [ which( A == "NA") ] <- 900;
>
> The "NA"s still appear as the entries of the array A.
>
> Can you tell me what is missing here? (I also tried setting the entries of
> A to character using "as.character" but it did not work)
>
> Thanks,
>
>
> --
> Yasin Gocgun
>
>         [[alternative HTML version deleted]]
>
> ______________________________________________
> 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.



--

Bert Gunter
Genentech Nonclinical Biostatistics

Internal Contact Info:
Phone: 467-7374