[R] NA value

Sarah Goslee sarah.goslee at gmail.com
Fri Jun 27 17:46:41 CEST 2008


Like this:


    for (i in files_rwl) {
         thisfile <- get(i)
         thisfile[is.na(thisfile)] <- 0
         assign(i, thisfile)
   }

It's likely that you could condense it, but using the long form makes it
clear what's happening.


Sarah

-- 
Sarah Goslee
http://www.functionaldiversity.org



More information about the R-help mailing list