Hello,
michaelyb wrote > > Ok. I appreciate your help. i don't understand what you guys mean by > "reproducible example", if you explained better, I will be more than glad > to post it. > > Regards, > Try this: R> A <- list(a=NULL, b=NULL) R> A R> dput(A) Now, the output of 'dput' is a reproducible data example, just copy/paste/assign with '<-' R> X <- structure(list(a = NULL, b = NULL), .Names = c("a", "b")) And test the suggestions above. (Just the first.) R> lapply(X, function(ll) ifelse(is.null(ll),NA,ll)) # works Use 'dput' and copy&paste it's output here, in your post, for us to have an exact example of your data. Clear enough? Rui Barradas. -- View this message in context: http://r.789695.n4.nabble.com/Filling-empty-List-in-a-FOR-LOOP-tp4522694p4524695.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.