yfit <- yfit*diff(h$mids[1:2])*length(x)

It reduces to a vector equal to yfit * 32. It's not obvious what purpose the calculation serves.

(BTW, this is simple enough not to require one, but a reproducible example, called a reprex is always a good idea.)