Update generate.r

Fixed cut and paste error