This is a terribly simple request, and I cannot believe that I have not yet found a solution for this, but I have searched for it far and without luck.
I have a .Rnw file loaded in Emacs, I use Mn s to compile it. Everything works well, and even opens the R buffer. Excellent. But this buffer is completely useless: it does not contain the objects that I just received.
Example of a minimal .Rnw file:
\documentclass{article} \begin{document} <<>>= foo <- "bar" @ \end{document}
Using Mn s , I now have a new R buffer with a loaded session, but:
> foo Error: object 'foo' not found
This is disappointing. I would like to play with the data interactively. How do I achieve this? I donโt want me to look for a file in turn, or by region with Cc Cc or something like that every time my code changes. Ideally, this should be exactly the same as the RStudio source function, which leaves me with a fully prepared R session.
I have not tried this with sweave, only with knitr.
EDIT: The eval=TRUE chunk parameter does not seem to produce the correct behavior.
source share