[R] ignoring zeros or converting to NA

stephen sefick ssefick at gmail.com
Tue Aug 12 21:11:43 CEST 2008


when you read it in na.string=0

On Tue, Aug 12, 2008 at 1:43 PM, rcoder <mpdotbook at gmail.com> wrote:
>
> Hi everyone,
>
> I have a matrix that has a combination of zeros and NAs. When I perform
> certain calculations on the matrix, the zeros generate "Inf" values. Is
> there a way to either convert the zeros in the matrix to NAs, or only
> perform the calculations if not zero (i.e. like using something similar to
> an !all(is.na() construct)?
>
> Thanks,
>
> rcoder
> --
> View this message in context: http://www.nabble.com/ignoring-zeros-or-converting-to-NA-tp18948979p18948979.html
> Sent from the R help mailing list archive at Nabble.com.
>
> ______________________________________________
> 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.
>



-- 
Let's not spend our time and resources thinking about things that are
so little or so large that all they really do for us is puff us up and
make us feel like gods. We are mammals, and have not exhausted the
annoying little problems of being mammals.

	-K. Mullis



More information about the R-help mailing list