Hi,
This is quick and dirty code. There is, for sure, a way more elegant way of doing this in R. Since I am in a hurry this should get you started for the table structure you provided...
> df1 <- read.table("df1.txt")
> df2 <- read.table("df2.txt")
> df1
V1 V2 V3 V4
1 Gene MPK MPKK MPKKK
2 Mutation D888H T66S D44G
3 Sample * * *
4 1 X X X
5 2 X X X
6 3 X X X
> df2
V1 V2 V3
1 Gene Values Mutation
2 MPK 211 D888H
3 MPKK 443 T66S
4 MPK 44 D334G
5 MPKK 222 S434G
6 MPKKK 223 D44G
for(i in 2:ncol(df1)){
+ tmp <- df2[which(df2[,1]==df1[1,i]),]
+ df1[3,i] <- tmp[which(tmp[,3]==df1[2,i]),2]
+ }
> df1
V1 V2 V3 V4
1 Gene MPK MPKK MPKKK
2 Mutation D888H T66S D44G
3 Sample 211 443 223
4 1 X X X
5 2 X X X
6 3 X X X
Feel free to modify etc...
HTH,
Phil