I'm sure there is a fairly straight forward solution to my problem. However, my limited R-skills let me down and I didn't come across a suitable solution yet.
I have a matrix A looking like:
year    Avg_temp
1990    14.3
1991    14.6
1992    14.5
1993    14.4
1994    14.9
1995    15.1
1996    15.2
And a matrix B which looks like:
year    Tot_hoursofsun
1992    950
1993    960
1994    945
I would like to do a VLOOKUP (or index match); the objective is to add a column with the hours of sun, in case this value is present in matrix B for the years of matrix A. See below the desired output:
year    Avg_temp    Tot_hoursofsun
1990    14.3    Not available
1991    14.6    Not available
1992    14.5    950
1993    14.4    960
1994    14.9    945
1995    15.1    Not available
1996    15.2    Not available
Thanks a lot in advance!
 
     
     
    