R-matrix arising from affine Hecke algebras and its application to Macdonald's difference operators