modified to allow execution of R code during document creation.  Added ability to dynamically reference values in the document to calculated R variables.