R factor analysis issue dealing with NA -


i learning factor analysis, , have read there no way, in r, result data has na's in every row (even though row may have hundreds of complete datapoints). there way allow na's? dataset has @ least 1 na per row removing na's isnt option me. simple example of problem:

col1   col2   col3 .... 3      4       na  .... 1      na      na  .... na     2       2   .... 

my code:

#--------------------------------factor analysis-------------- #read in csv file data. stored in var called csv nums<-sapply(csv,is.numeric) num_only=csv[,nums] num_only=na.omit(num_only) matrix<-as.matrix(num_only) anal<-factanal(matrix,rotation="promax") 

my error (occurs because removing na , non-numeric removes data matrix):

error in factanal(matrix, rotation = "promax") :  factor analysis applies numerical variables 


Comments

Popular posts from this blog

c++ - Difference between pre and post decrement in recursive function argument -

php - Nothing but 'run(); ' when browsing to my local project, how do I fix this? -

php - How can I echo out this array? -