Problem with complete.cases

I get the following error:

Error in complete.cases(dt) : invalid 'type' (list) of argument 

This message has never been before using complete.cases in a data frame.

The class(dt) data.frame returns data.frame , so there is no problem.

dt relatively large - 800,000 surveys out of 90 variables.

Similar operations with other data frames do not occur.

Does anyone know what the problem is?

+6
source share
1 answer

I also ran into the same problem. As @hrbrmstr correctly pointed out, data.frame has list objects. In my case, it was data.frame lists.
I converted the data.frame of the lists to the actual data frame using the following command:

 DF <- data.frame(matrix(unlist(DF), nrow=nrow(DF)),stringsAsFactors=FALSE) 

Using complete.cases on this worked out.

+5
source

All Articles