I have this data and I want to tabulate the columns on conditions based on q8_12:
q8_12   q8_13_1 q8_13_2 q8_13_3 q8_13_4 q8_13_5
YES NO  NO  NO  NO  NO
YES NO  NO  NO  YES NO
NO  NO  NO  NO  NO  NO
NO  NO  NO  NO  NO  NO
NO  NO  NO  NO  NO  NO
YES NO  NO  NO  NO  NO
NO  NO  NO  NO  NO  NO
YES NO  NO  NO  NO  NO
YES NO  NO  NO  NO  YES
YES NO  NO  NO  NO  YES
YES NO  NO  NO  NO  YES
YES NO  NO  NO  NO  NO
YES NO  NO  NO  YES NO
NO  NO  NO  NO  NO  NO
I am using the if function:
if(q8_12=='YES') table(q8_13_11)
and I get this error
Warning in if (q8_12 == "YES") table(q8_13_11) :
the condition has length > 1 and only the first element will be used
Anyone has an idea of how to go about this problem?
 
     
     
    