[R] replace NULL with NA in matrix

2008-04-17 Thread Tim Smith
Hi, I had a matrix with NULL values, which I wanted to replace with NA. Is there an efficient way to do this? Small sample input matrix: A B C D E 1 5222.18 6355.10 4392.68 2607.41 4524.09 2NULL 257.33NULL 161.51 119.44 3NULL 274.80 305.28

Re: [R] replace NULL with NA in matrix

2008-04-17 Thread Uwe Ligges
Tim Smith wrote: Hi, I had a matrix with NULL values, which I wanted to replace with NA. Is there an efficient way to do this? Small sample input matrix: A B C D E 1 5222.18 6355.10 4392.68 2607.41 4524.09 2NULL 257.33NULL 161.51 119.44 3

Re: [R] replace NULL with NA in matrix

2008-04-17 Thread Marc Schwartz
Tim Smith wrote: Hi, I had a matrix with NULL values, which I wanted to replace with NA. Is there an efficient way to do this? Small sample input matrix: A B C D E 1 5222.18 6355.10 4392.68 2607.41 4524.09 2NULL 257.33NULL 161.51 119.44 3

Re: [R] replace NULL with NA in matrix

2008-04-17 Thread Prof Brian Ripley
On Thu, 17 Apr 2008, Uwe Ligges wrote: Tim Smith wrote: Hi, I had a matrix with NULL values, which I wanted to replace with NA. Is there an efficient way to do this? Small sample input matrix: A B C D E 1 5222.18 6355.10 4392.68 2607.41 4524.09 2NULL

Re: [R] replace NULL with NA in matrix

2008-04-17 Thread Katharine Mullen
if your matrix is stored in a text file then xx - read.table(x, na.strings=NULL) where x is the name of the text file. On Thu, 17 Apr 2008, Tim Smith wrote: Hi, I had a matrix with NULL values, which I wanted to replace with NA. Is there an efficient way to do this? Small sample input