Hello Rui, Sorry I read your post after having answered to jeff.
If seems effectively to be better than ifelse, thanks. But I still have some errors: Error in x[1:8700, 1] : incorrect number of dimensions AND In is.na(xx) : is.na() applied to non-(list or vector) of type 'NULL It seems to have modified the length of my data, due to these NAs -- View this message in context: http://r.789695.n4.nabble.com/how-to-ignore-NA-with-NA-or-NULL-tp4632287p4632315.html Sent from the R help mailing list archive at Nabble.com. ______________________________________________ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.