Re: [R] Exclude NA while summing

2011-11-17 Thread R. Michael Weylandt
Or, for this specific application rowSums(XXX, na.rm = TRUE) Michael On Thu, Nov 17, 2011 at 5:51 AM, Jim Holtman wrote: > change to > >> row.sums.m <- apply(dummy.curr.res.m,1,sum, na.rm = TRUE) > > Sent from my iPad > > On Nov 17, 2011, at 5:18, Vikram Bahure wrote: > >> Dear R users, >> >>

Re: [R] Exclude NA while summing

2011-11-17 Thread Jim Holtman
change to > row.sums.m <- apply(dummy.curr.res.m,1,sum, na.rm = TRUE) Sent from my iPad On Nov 17, 2011, at 5:18, Vikram Bahure wrote: > Dear R users, > > I am new to R and have some query. > > I am having a dataset with binary output 0's and ones. But along with it it > has NA's too. I want

[R] Exclude NA while summing

2011-11-17 Thread Vikram Bahure
Dear R users, I am new to R and have some query. I am having a dataset with binary output 0's and ones. But along with it it has NA's too. I want to sum all the rows and get the sum total for each column. But whenever there is a NA in an row the sum of the row is returned as NA so I am not able