Hi, I have a list of 100 data frames, each data frame has 50 obs of 377 variables.
I would like to replace all the NAs with 0 in all the dataframes. Should I have a for loop for every data frame? Below is an extract of how the data looks like. List of 100 $ :'data.frame': 50 obs. of 377 variables: ..$ ACHRPO: int [1:50] NA NA NA NA NA NA NA NA NA NA ... ..$ ACTEEX: int [1:50] NA NA NA NA NA NA NA NA NA NA ... ..$ ACTIML: int [1:50] NA NA NA NA NA NA NA NA NA NA ... ..$ ADENMA: int [1:50] NA NA NA 2 NA NA NA NA NA NA ... $ :'data.frame': 50 obs. of 377 variables: ..$ ACHRPO: int [1:50] NA NA NA NA NA NA NA NA NA NA ... ..$ ACTEEX: int [1:50] NA NA NA NA 2 NA NA NA NA NA ... ..$ ACTIML: int [1:50] NA NA NA NA 1 NA NA NA NA NA ... ..$ ADENMA: int [1:50] NA NA NA NA NA NA NA NA NA NA ... Thanks. Kang Min ______________________________________________ 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.