From ?par :
'lend' The line end style. This can be specified as an integer or string: '0' and '"round"' mean rounded line caps [_default_]; '1' and '"butt"' mean butt line caps; '2' and '"square"' mean square line caps.
For example:
plot(0:1,0:1,type="n") par(lend=0); segments(0,0.2,1,0.2,lwd=8) par(lend=1); segments(0,0.4,1,0.4,lwd=8) par(lend=2); segments(0,0.6,1,0.6,lwd=8)
or segments(0,0.2,1,0.2,lwd=8, lend=1) , etc. 
(You should look quite carefully to see the difference, especially between the βbuttβ and the βsquareβ caps)
Ben bolker
source share