replace all inline R code with code chunks when a value is first computed

this is to comply with the rubric requirement that there be code visible
for all computations
values referenced a second time are left with inline computation
regen