Skip to content
Prev 3045 / 398500 Next

zero replacement

On Mon, Aug 02, 1999 at 03:14:43PM -0700, Michael Camann wrote:
I might be missing something, but why not:

  x[x==0] <- NaN

  A small test example:
[,1] [,2] [,3]
[1,]    0    0    0
[2,]    0    0    0
[3,]    0    0    0
[,1] [,2] [,3]
[1,]  NaN  NaN  NaN
[2,]  NaN  NaN  NaN
[3,]  NaN  NaN  NaN
[,1] [,2] [,3]
[1,] TRUE TRUE TRUE
[2,] TRUE TRUE TRUE
[3,] TRUE TRUE TRUE
Message-ID: <19990803122253.B29898@jimmy.harvard.edu>
In-Reply-To: <199908022214.PAA03657@babylon.cnrs.humboldt.edu>; from Michael Camann on Mon, Aug 02, 1999 at 03:14:43PM -0700