Skip to content

interpolation function

8 messages · Tom, 吴 昊, Adaikalavan Ramasamy +4 more

Tom
#
On Fri, 2005-05-08 at 12:12 +0000, å´ æ˜Š wrote:
Does this look like an answer? If anyone knows a better way please tell
me.
+ d.mat[,i][d.mat[,i]==0]<-mean(d.mat[,i][d.mat[,i]>0])
+ }

Thanks
Tom
Tom
#
Can someone please explain why this works:
Whereas:
+ d.mat[,i][d.mat[,i]==NA]<-mean(d.mat[,i],na.rm=TRUE)
+ }
dosnt

Thanks
Tom
#
Hi,
I have a sparse matrix.I want to fill values into the entries whose value 
is 0.The new generated values should come from the interpolation of the 
values have existed.Does R provide such interpolation functions which 
operate on Matrix, for example ,such a matrix below
 0  0  0  0  2.3  0 0  0  0 
 0  0 3.1 0   0   0 0 1.4 0
 0  0  0  0   0   0 0  0  0
1.1 0  0  0   0   0 0  0  0
 0  0  0  4   0   0 0  0  6
 0  0  0  0   0   0 0  0  0
 0  0  0  0   0   7 0  0  0
 0  3  0  0   0   0 6  0  0
 0  0  0  0   9   0 0  0  0
thanks a lot
hao wu
#
I do not understand your question. If this was not a sparse matrix, then
I would have asked you refer into the missing value literature. Even
there, people generally remove any columns/rows that have too many
missing values to avoid unreliable results. 

And since this is a sparse matrix, you are going to have too many
missing values on all rows and columns. I could be wrong but if I am,
someone will tell me that soon enough.

Regards, Adai
On Fri, 2005-08-05 at 12:12 +0000, å´ æ˜Š wrote:
#
To test for 'NA' you shouldn't use '=='.  Use 'is.na()' instead.

-roger
tom wright wrote:

  
    
#
tom wright wrote:
d.mat[,i] == NA returns NA. You want ?is.na to test for missing values.

--sundar
#
Robert Kinley wrote:

            
And if it is not clear why, try:

 > NA == NA
[1] NA
 >
 Kjetil
-- 

Kjetil Halvorsen.

Peace is the most effective weapon of mass construction.
               --  Mahdi Elmandjra