From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Eric Schulte" Subject: Re: Re: Org-mode and ESS Date: Wed, 12 Nov 2008 19:22:08 -0800 Message-ID: <87myg4z4wv.fsf@gmail.com> References: <2c75873c0811111000m3c80e8e4rf08b742e80300cd0@mail.gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1L0SmQ-0004O0-TB for emacs-orgmode@gnu.org; Wed, 12 Nov 2008 22:22:02 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1L0SmP-0004Nm-5h for emacs-orgmode@gnu.org; Wed, 12 Nov 2008 22:22:02 -0500 Received: from [199.232.76.173] (port=49666 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1L0SmO-0004Nj-Uo for emacs-orgmode@gnu.org; Wed, 12 Nov 2008 22:22:00 -0500 Received: from rv-out-0708.google.com ([209.85.198.247]:47608) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1L0SmO-0003QZ-Ux for emacs-orgmode@gnu.org; Wed, 12 Nov 2008 22:22:01 -0500 Received: by rv-out-0708.google.com with SMTP id k29so820686rvb.6 for ; Wed, 12 Nov 2008 19:21:58 -0800 (PST) List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Austin Frank Cc: emacs-orgmode@gnu.org Austin Frank writes: > On Tue, Nov 11 2008, Graham Smith wrote: > >> Is any one using Org-mode with ESS. ESS seems to need a file with a >> *.R name to work, but it would be really useful to use Org-mode >> features to keep notes of comments and code, before sending to R, and >> of course to copy results back into an Org-Mode file from R. >> >> As a search here and a google hasn't thrown up anything obvious, I >> assume not, but I thought I would ask. > > In my local git repo of the org sources I have a pretty nice setup for > using R or S inside org-mode. I liked the in-file native editing of > source code so much that I decided that I wanted to use org files as > source files with Sweave (instead of using .Rtex or .Rnw files). My > goal was to export documents with embedded R code, rather than to use > org within the comments of R files. I can certainly see a use for the > latter approach (which seems to be what you have in mind), as well. > > There was recently a thread where someone created a preprocessing system > for specific types of blocks. Hi Austin, I would be interested to help extend the block prepreocessing system to handle cases like the one you mention here. > > Basically, in the workflow I've developed, I create a file with the > extension .Rorg, say homework_key.Rorg. Within that file, I can embed > blocks of R code, and can refer to variables defined in the R code > contained in the document. > > #+BEGIN_R > a <- 3 > a > #+END_R > > * the value of a is \R{a} > * the value of a + 3 is \R{a + 3} > In the above example how would you/Sweave handle the case where there are multiple R blocks in the same file? For example #+BEGIN_R a <- 3 a #+END_R - the value of a is \R{a} - the value of a + 3 is \R{a + 3} #+BEGIN_R a <- 8 a #+END_R - the value of a is \R{a} - the value of a + 3 is \R{a + 3} With that questions answered it should be relatively straightforward to implement exporting as you described using only org-mode's block processing, and letting ESS do the actual calculations all without any dependence on Sweave. > I haven't put the code anywhere public because there are several things > I still need to do: > > - test graphic creation and export if you have examples of graphic creation, I'd be interested to see how they work, and relatedly how difficult it would be to move that functionality into org-mode. However I think the rest of the point you make immediately below would be easily addressed through using an org-mode only approach. > - improve generation of latex headers > - automate processing from .Rorg to .tex (or .pdf) (currently at least 3 > steps, should be 1) > - come up with suggested keybindings for inserting the #+BEGIN/END_R > blocks If you happen to use yasnippets, I find it makes the creation of blocks in org files a very quick/easy experience. See http://legito.net/worg/org-configs/index.php#sec-2.1 for details. > > - create a driver to generate HTML instead of \LaTeX > Cheers -- Eric