I embed R code regularly in Rnw files and use it knitrto convert the Rnw file to a tex file and then to pdf. The surface of this approach is to increase reproducibility. The disadvantage is that it interrupts the flow of the recording process.
For example, suppose the following is indicated in the results section of a research document:
I compared the means of group A and group B. The average value of group A was \Sexpr{mean(groupA)}. The mean of group B was \Sexpr{mean(groupB)}. (the following couple sentences then put the two tools in context, interpret the meaning of the two tools and explain the significance of their difference)
To place funds in context, interpret their meaning and explain the significance of their difference, I need to be able to see the actual value of each average. But I do not see the value of each average without starting knitrto convert to tex, and then to pdf, which fragmentes and blocks the flow of the recording process.
Do people use any methods that allow the R-code to run in the Rnw file. In the above example, is there a way to display the value of each average in the Rnw file, so that the message flow is not interrupted? Or are there any workarounds?
source
share