Data contains multiple columns and 3000 row
Same OrderNo
but different Ordertype
.
I want to get all the OrderNo
whose Ordertype
are different in the two data frame.
I have isolated the two columns from the two data frame and set them in ascending order. Then I tried to use the function cbind
to combine the two columns and find the missing values in one of the columns.
xxx <- data.frame( orderNo = c(1:10), Ordertype = c("a", "b", "c", "d", "a", "b", "c", "d", "e", "f"))
yyy <- data.frame( orderNo = c(1:10), Ordertype = c("a", "b", "c", "d", "a", "b", "e", "d", "e", "f"))
In the above example: OrderNo
"7" corresponds to "c" in one data frame and "e" in another data frame. I want a set of all such number with a different value in the column Ordertype
as my output.
OrderNo
"8" corresponds to "d". Are you sure you have given enough information for us to try to help you? – Vitali Avagyanxxx$orderNo[xxx$Ordertype != yyy$orderType]
? – jdobreswhich(xxx$Ordertype != yyy$Ordertype)
– Ritchie Sacramento