Re: [R] Summary: Process multiple columns of data.frame

2007-11-23 Thread Gregor Gorjanc
Thompson, David (MNR ontario.ca> writes: > Thank you Jim Holtman and Mark Leeds for your help. > > Original question: > >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

[R] Summary: Process multiple columns of data.frame

2007-11-22 Thread Thompson, David (MNR)
Thank you Jim Holtman and Mark Leeds for your help. Original question: >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 >. . . Solution: for (i in c('bd.n', 'ht.n', 'db