Hello
I have two dataframes df1 and df2
df1 <- data.frame(id = c("1-1","1-1","1-1","1-1","1-1"),
group = c(1,1,1,2,2),
product = c(1,2,3,4,5),
client = c("90-1", "90-1","90-1","90-1","90-1"))
df2 <- data.frame(id = c("1-1","1-1","1-1","1-1","1-1"),
group = c(1,1,1,2,2),
product = c(1,2,9,4,5),
client = c("90-1", "90-1","90-1","90-1","90-1"))
> df2
id group product client
1 1-1 1 1 90-1
2 1-1 1 2 90-1
3 1-1 1 9 90-1
4 1-1 2 4 90-1
5 1-1 2 5 90-1
> df1
id group product client
1 1-1 1 1 90-1
2 1-1 1 2 90-1
3 1-1 1 3 90-1
4 1-1 2 4 90-1
5 1-1 2 5 90-1
>
1. How Can you obtain a resut that shows the products mach or not as a TRUE and FALSE?
Or similar output:
id group product client new
1 1-1 1 1 90-1 TRUE
2 1-1 1 2 90-1 TRUE
3 1-1 1 3 90-1 FALSE
4 1-1 2 4 90-1 TRUE
5 1-1 2 5 90-1 TRUE
2. How can you graph it?
Thank you very much!