I Have two different data frames DF1 and DF2. I want to exclude the rows of DF1 which matches with the data frame DF2 and my resulting data frame would look like DF3. Additionally I want Pass the condition as If my Room number is All Rooms then I would be able to match columns Code, Description and Company from DF2 to DF1, if My room number column does not contains All Rooms then it should match the columns Code, Description, Company and Room number.
Code=c("A","B","C","E","D")
Desciption=c("Color is not Good","Odour is not good","Astetic Issue","Odour is not good","Lighting issue")
Company=c("Asian Paints","Burger","Asian Paints","Burger","Burger")
`Room number`=c("Room_1","Room_1","Room_2","Room_3","Room_2")
Rating=c("2","3","5","4","3")
DF1=data.frame(Code,Desciption,Company,`Room number`,Rating)
Code Desciption Company Room.number Rating
1 A Color is not Good Asian Paints Room_1 2
2 B Odour is not good Burger Room_1 3
3 C Astetic Issue Asian Paints Room_2 5
4 E Odour is not good Burger Room_3 4
5 D Lighting issue Burger Room_2 3
Code=c("A","B")
Desciption=c("Color is not Good","Odour is not good")
Company=c("Asian Paints","Burger")
`Room number`=c("Room_1","All Rooms")
DF2=data.frame(Code,Desciption,Company,`Room number`)
> DF2
Code Desciption Company Room.number
1 A Color is not Good Asian Paints Room_1
2 B Odour is not good Burger All Rooms
Code=c("C","D")
Desciption=c("Astetic Issue","Lighting issue")
Company=c("Asian Paints","Burger")
`Room number`=c("Room_2","Room_2")
Rating=c("5","3")
DF3=data.frame(Code,Desciption,Company,`Room number`,Rating)
> DF3
Code Desciption Company Room.number Rating
1 C Astetic Issue Asian Paints Room_2 5
2 D Lighting issue Burger Room_2 3
Can someone help me to solve this