mardi 11 août 2020

comparing three categorical columns and representing the results with 0,1 or 2

How can I compare the categorical content of one of my columns with the content of 3 others? For example, if the data of x is the same as the one of y it will be represented by 0, is it the same as the v it will be represented by 1 and if the same as z by 2.

x<- c(C,T,T,G,A,A,T,C,G)
y<- c(C,G,G,T,G,C,C,A,T)
v<- c(A,C,T,C,G,G,T,A,C)
z<- c(CTC,CCT,ATC,AC,T,CC,GC,AC,CTAC)

Aucun commentaire:

Enregistrer un commentaire