Update gradients.r

library -> require