In R markdown (knitr package), can I access a variable within the body of the document that was calculated in a code chunk?
Yes. You can simply call any previously evaluated variable inline.
e.g. If you had previously created a data.frame
in a chunk with df <- data.frame(x=1:10)
`r max(df$x)`
Should produce
10