I have a data frame of 166 people which I would like to convert to a binary matrix. So in the data frame it looks like the following:

I am just wondering what code could I use to convert this to binary i.e 1/0s
A = absent
N = no 
Y = yes 
All for votes
Any help would be appreciated !
 
     
    