I'm not able to get a solution, for my below requirement. If a data.table(as below) has matching values in Col1 and Col3. Replace Col2 value(old with New-Val).
Col1 Col2 Col3
1 old a
1 old a
1 New-Val a
After manipulating data table should look as below:
Col1 Col2 Col3
1 New-Val a
1 New-Val a
1 New-Val a
Update:
I've written New-Val for understanding the requirement. However I cannot match this value because it varies for different Col1 and Col3 values. For example as below:
Col1 Col2 Col3
1 blank a
1 blank a
1 New1 a
2 blank b
2 new2 b
2 new2 b
Likewise the entries are huge. So I ideally want to match Col1 and Col3 and in Col2 it is blank(always) which is to be replaced irrespective of different matched Col1 and Col3 values.
This should be manipulated to:
Col1 Col2 Col3
1 New1 a
1 New1 a
1 New1 a
2 new2 b
2 new2 b
2 new2 b
Col1
andCol3
? β David Arenburg