Measurements of the spin rotation parameter R in pp and π+p elastic scattering at 45 GeV/c