[Rd] na.omit and class conversion (PR#6967)

mark0060 at tc.umn.edu mark0060 at tc.umn.edu
Thu Jun 10 19:00:27 CEST 2004


Full_Name: Kristian E. Markon
Version: 1.90
OS: WinXP
Submission from: (NULL) (24.26.179.28)


I have been having problems with na.omit, and am not sure if it is a bug, or new
behavior.

Basically, I observe exactly the same behavior as described in the bug
Language-fixed/522, but it occurs with classes other than matrices, including
data.frames. I am not sure how to reproduce it, as it sometimes occurs with
matrices, and sometimes not, and sometimes with data.frames and sometimes not.
It does occur repeatedly, however. 

I have observed another issue that may be related: It sometimes seems that
classes are not being converted. 

For example, if I do a factor analysis and save the loading matrix in an
object--e.g.,

temp.fa = factanal(covmat=x.cor, factors=2)

temp.load = temp.fa$load

I will sometimes get error messages that such and such is not possible with
loading matrices. 

For example, if I try to put the loadings in a list, and then convert the list
to a data.frame, as in

as.data.frame(list(items=names, load=temp.load)), I get an error stating that
loadings cannot be converted to data.frames. 

This error persists if I convert the loading matrix to a matrix class--e.g.,

as.data.frame(list(items=names, load=as.matrix(temp.load)))

However, if I create a matrix, and assign the loadings to this matrix--e.g.,

load.mat = matrix(nrow=35,ncol=2)

load.mat[1:35,1:2] = as.matrix(temp.load)

then the following command 

as.data.frame(list(items=names, load=temp.load))

works as expected. 

The reason why I suspect the na.omit problem may be related is that I seem to
observe na.omit problems more often when dealing with objects that have been
converted from one class to another.



More information about the R-devel mailing list