The lowess(x,y) function can be used directly to add a lowess curve to a plot:
plot(urb,infmor) lines(lowess(urb,infmor))
Here we add several lowess curves with different smoothing window spans. f=.1 means that the smoothing window (span) includes a fraction of .1 of the observations (i.e. 10% of the observations).
plot(urb,infmor) lines(lowess(urb,infmor,f=.2),col="red") lines(lowess(urb,infmor,f=.4),col="blue") lines(lowess(urb,infmor,f=.6),col="green") lines(lowess(urb,infmor,f=.8),col="black")
loess() is a more recent version that offers many more options; variables can be specified using a formula.