[R] Process multiple columns of data.frame

Thompson, David (MNR) David.John.Thompson at ontario.ca
Tue Nov 20 18:27:35 CET 2007


Hello,

How do I do the following more concisely?
	Bout[is.na(Bout$bd.n), 'bd.n'] <- 0
	Bout[is.na(Bout$ht.n), 'ht.n'] <- 0
	Bout[is.na(Bout$dbh.n), 'dbh.n'] <- 0

Would the form of such a command be different
between numeric, character and factor columns?

. . . between data.frames and matrices?

Thanx, DaveT.
*************************************
Silviculture Data Analyst
Ontario Forest Research Institute
Ontario Ministry of Natural Resources
david.john.thompson at ontario.ca
http://ofri.mnr.gov.on.ca



More information about the R-help mailing list