A comparative study of the magnetocaloric effect in RNi2 (R=Dy, Ho, Er) intermetallic compounds