prototyped box-drawing procedure in R