I want to intersect my data-frame based on two columns single column i can do that using the intersect function but how to go about two columns.
Here is my sample data-frame
head(Region)
ENSEMBL UP_DOWN
1 ENSG00000000457 UP
2 ENSG00000000460 UP
3 ENSG00000000938 UP
4 ENSG00000000971 UP
5 ENSG00000001084 DOWN
6 ENSG00000001460 UP
The second data-frame
head(gene)
ENSEMBL UP_DOWN
1 ENSG00000000003 DOWN
2 ENSG00000000938 UP
3 ENSG00000001630 DOWN
4 ENSG00000002822 DOWN
5 ENSG00000004059 DOWN
6 ENSG00000004139 DOWN
So far what im doing is this
c <- as.data.frame(intersect(Region$ENSEMBL,gene$ENSEMBL))
But I lose the information if that respective row is either "UP
" or "DOWNN
" in either of my data-frame. How do i label that? information