I have been trying to sort the rows of my dataset(A2) to match multiple columns of another dataset (A1). I used a code sometime back and it worked perfectly. Today I modified the code to use on a new data set and I am getting NA's which I shouldn't be getting.

This is the code I am using

```
A4 <- A2[match(paste(A1$Subject,A1$Condition,A1$test, A1$Replication), paste(A2$Subject,A2$Condition,A2$test,A2$Replication)),]

```

Data:

```
A1 <- structure(list(Subject = c(1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 
2, 2, 2, 2), Condition = c(1, 1, 2, 2, 1, 1, 2, 2, 1, 1, 2, 2, 
1, 1, 2, 2), test = c(1, 1, 1, 1, 2, 2, 2, 2, 1, 1, 1, 1, 2, 
2, 2, 2), Replication = c(101, 108, 103, 105, 101, 108, 103, 
105, 101, 108, 103, 105, 101, 108, 103, 105), Movement = c(43, 
56, 45, 43, 35, 34, 34, 3, 4, 67, 45, 34, 65, 34, 345, 23)), row.names = c(NA, 
-16L), class = c("tbl_df", "tbl", "data.frame"))

A2 <-structure(list(Subject = c(2, 2, 2, 2, 2, 2, 2, 2, 1, 1, 1, 
1, 1, 1, 1, 1), Condition = c(1, 1, 2, 2, 1, 1, 2, 2, 1, 1, 
2, 2, 2, 1, 1, 2), test = c(1, 1, 1, 1, 2, 2, 2, 2, 1, 1, 1, 
1, 2, 2, 2, 2), Replication = c(108, 101, 103, 105, 101, 108, 
103, 105, 108, 101, 103, 105, 101, 108, 103, 105), Movement = c(43, 
56, 45, 43, 35, 34, 34, 3, 4, 67, 45, 34, 65, 34, 345, 23)), row.names = c(NA, 
-16L), class = c("tbl_df", "tbl", "data.frame")) 

```