[ESS] knitr

Rasmus rasmus at gmx.us
Wed Jun 6 23:14:44 CEST 2012


Brett Presnell <presnell at stat.ufl.edu> writes:

> Code "chunks" in org-mode (delimited by #+BEGIN_SRC and #+END_SRC) can
> be edited in a separate emacs window by typing C-c '.  This window is
> opened in the appropriate mode (ESS for R code) and saved back to the
> document by typing C-c ' again.

I love Org-mode, but I prefer the behavior of the ESS noweb mode.  It
would still be convenient for long code chucks, though.  I guess it
should be somewhat easy to write up a narrow to chuck function.

> I'm not sure where the implementation would have to take place for Rnw
> or knitr files (ESS?  AUCTeX?  Both?), but something like this would
> avoid mode switching between AUCTeX and ESS, which has never worked
> properly for me (maybe because I find it incredibly cumbersome to avoid
> all use of dollar signs in my R code).  This may seem like a minor
> thing, but these mode switching problems often make editing Rnw files
> into a fairly painful experience for me, and I do a lot of it.
>
> Does no one else have this problem anymore?

I sometimes have this problem, but not to often as I usually externalize
my R-code now¹.  If I have the problem I insert a line with
  % $
which solves the problem, but is tedious.

–Rasmus

Footnotes: 
¹  http://yihui.name/knitr/demo/externalization/

-- 
In theory, practice and theory are the same. In practice they are not



More information about the ESS-help mailing list