r code for 2d interpolation for IR