I have two data.tables. I want to merge information from the second data.table with the first:

```
DT1 <- fread(
"Val C   D  E   F   iso   year   
1    NA  1  NA  NA  NLD   2001
1    NA  2  NA  NA  NLD   2002       
1    NA  3  NA  NA  GRC   2001             
1    NA  3  NA  NA  GRC   2002",
header = TRUE)

DT2 <- fread(
"Val name  O   P  Q   R   iso   year   
1   A     NA  1  NA  NA  NLD   2001
1   A     NA  2  NA  NA  NLD   2001   
1   B     NA  1  NA  NA  NLD   2001
1   B     NA  2  NA  NA  NLD   2002
1   A     NA  1  NA  NA  NLD   2002
1   B     NA  2  NA  NA  NLD   2002         
1   C     NA  3  NA  NA  GRC   2001  
1   C     NA  3  NA  NA  GRC   2001
1   C     NA  3  NA  NA  GRC   2001        
1   A     NA  3  NA  NA  GRC   2002
1   A     NA  3  NA  NA  GRC   2002          
1   B     NA  3  NA  NA  GRC   2002",
header = TRUE)

```

I want to add the information under `name` of `DT2` to `DT1` as follows. If for `iso` == `NLD` the name `A` exists (no matter how often), the column A is filled with A, if not it remains NA:

```
DT1 <- fread(
"Val    C   D  E   F   iso   year   A B C
 1      NA  1  NA  NA  NLD   2001   A B NA
 1      NA  2  NA  NA  NLD   2002   A B NA   
 1      NA  3  NA  NA  GRC   2001   NA NA C         
 1      NA  3  NA  NA  GRC   2002   A B NA",
header = TRUE)

```

But I don't know how to get there. I have been trying something like:

```
DT[,A:="A"]
DT[,B:="B"]
DT[,C:="C"]
DT2$name[DT, on=c(iso="iso", year="year", name="A"), nomatch=0L]

```

or

```
merge(DT, DT2$name, on=c(iso="iso", year="year", A="name"), all.x = TRUE, allow.cartesian=FALSE)

```

But I think have to solve it differently. Could anyone help me out?