Re: [R] problem with conditional column sums

2015-01-29 Thread Chel Hee Lee
Or, you can also do the same job using 'colSums()' as shown in the below: > colSums(status=="I") 2010 2011 2012 344 > I hope this helps. Chel Hee Lee On 1/28/2015 7:31 PM, JSHuang wrote: Hi, I think you need quotation around I like the following: status 2010 2011 2012 1

Re: [R] problem with conditional column sums

2015-01-28 Thread JSHuang
Hi, I think you need quotation around I like the following: > status 2010 2011 2012 1 AAA 2 AII 3 AAA 4 UUU 5 AAA 6 III 7 UII 8 AUA 9 IAU 10III > apply(start,2,function(x)