[R] Prevent calculation when only NA

jeff6868 geoffrey_klein at etu.u-bourgogne.fr
Mon May 21 10:50:26 CEST 2012


Hi Jim,

Thanks for your answer.
I tried your proposition. The idea seems to be good but I still have my
error.
Actually, the error is in the next function, which uses the function
get.max.cor I told you before.
I also tried these 2 functions with data containing no missing data, and it
works well.
But I think that the next function is doing the calculation by column (it
seems to read each column). 
Do you think it's possible to introduce in the function get.max.cor
something which stops the calculation for a file if there're only NAs in the
correlation matrix for this file, instead of removing the NAs?
For example: if there're only NAs in file2, don't try to do any calculation
with file2 and go to file3 (and so one)?
I think that this is the problem, because even if I remove NAs, it stills
wants to do a calculation. But as there're no numeric values, it gives an
error.


--
View this message in context: http://r.789695.n4.nabble.com/Prevent-calculation-when-only-NA-tp4630716p4630722.html
Sent from the R help mailing list archive at Nabble.com.



More information about the R-help mailing list