Skip to content
Prev 58775 / 398502 Next

remove missing values from matrix or data frame

Something is not as it seems:
1:  0        2.6875
3:  8.366667 6.625
5:  15.6     4.375
7:  23.4     6.25
9:  29       5.09375
11:  18       NA
13:  0        4.15625
15:  9.366667 6.25
17:  14.73333 5.875
19:  31.26667 6.15625
21:  NA       2.357
23:  NA       5.4234
25:  0        3.34375
27:  7.666667 2.78125
29:  NA       NA
31:
Read 30 items

and a looks like yours and
[,1]    [,2]
 [1,]  0.000000 2.68750
 [2,]  8.366667 6.62500
 [3,] 15.600000 4.37500
 [4,] 23.400000 6.25000
 [5,] 29.000000 5.09375
 [6,]  0.000000 4.15625
 [7,]  9.366667 6.25000
 [8,] 14.733330 5.87500
 [9,] 31.266670 6.15625
[10,]  0.000000 3.34375
[11,]  7.666667 2.78125
attr(,"na.action")
[1] 11 12 15  6
attr(,"class")
[1] "omit"

does something, in fact what you asked for.

So what is a?  What does str(a) say about it?
On Tue, 9 Nov 2004, William Briggs wrote: