Hi, I have a list called ds which has the following attributes: attributes(ds) $names [1] "adj.r.squared" "fstatistic" "intercept" "slope" [5] "std.error" "tstatistic"
I want to replace all the NaN is ds with 0, and after searching past posts I found I can hardcode it like this: ds$adj.r.squared=replace(ds$adj.r.squared,is.nan(ds$adj.r.squared),0) ds$fstatistic=replace(ds$fstatistic,is.nan(ds$fstatistic),0) ... ds$tstatistic=replace(ds$tstatistic,is.nan(ds$tstatistic),0) But, there has to be a more elegant/general solution. I've tried messing around with lapply but can't seem to get it to work. Any suggestion? thanks, mishkin -- View this message in context: http://r.789695.n4.nabble.com/replacing-NaN-for-every-attribute-in-my-data-tp4636160.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.