Good afternoon
I have this data frame
> head(d)
Gene.Name GO.term
1 EPCAM cell-cell adhesion
2 CDH17 cell adhesion
3 LGALS4 cell adhesion
4 GPRC5A cell-cell adhesion
5 KRT18 cell-cell adhesion
6 SOX9 cytoskeleton organsation
>
CGN cell-cell adhesion
> unique(d$GO.term)
[1] cell-cell adhesion cell adhesion
[3] cytoskeleton organsation oxidation-reduction
4 Levels: cell-cell adhesion ... oxidation-reduction
>
I want something like below where if a gene is in a GO.term that achieves 1 if not 0
> head(d[,1:2])
cell adhesion cytoskeleton organsation
AQP9 0 1
AXIN2 1 0
BCL6 1 0
BMP7 1 0
C5AR1 0 1
CCL2 0 1
>
But I don't know how to do that
Any help please?