Skip to content

problem with conditional column sums

2 messages · JSHuang, Chel Hee Lee

#
Hi, 

  I think you need quotation around I like the following:
2010 2011 2012
1     A    A    A
2     A    I    I
3     A    A    A
4     U    U    U
5     A    A    A
6     I    I    I
7     U    I    I
8     A    U    A
9     I    A    U
10    I    I    I
X2010 X2011 X2012 
    3     4     4 



--
View this message in context: http://r.789695.n4.nabble.com/problem-with-conditional-column-sums-tp4702426p4702434.html
Sent from the R help mailing list archive at Nabble.com.
#
Or, you can also do the same job using 'colSums()' as shown in the below:

 > colSums(status=="I")
2010 2011 2012
    3    4    4
 >

I hope this helps.

Chel Hee Lee
On 1/28/2015 7:31 PM, JSHuang wrote: