emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: "François Pinard" <pinard@iro.umontreal.ca>
To: emacs-orgmode@gnu.org
Subject: Discovering Babel and R combination!
Date: Sun, 15 Jul 2012 23:44:33 -0400	[thread overview]
Message-ID: <86d33w74ke.fsf@mercure.progiciels-bpi.ca> (raw)

Hi, Org people.

A while ago, I started to get acquainted a bit with Babel, mainly as a
curiosity for an area of Org I did not know nor use yet.  However, for a
couple of weeks now, I'm starting to better understand how useful the
combination of Babel and R may be in real situations.

While documenting a few databases, exploring them with R mainly, I first
developed the habit of saving some of my R code aside, as a reminder to
myself for later retries or further discussions with colleagues.  But
I'm finding out that it is much more fruitful to put the R code directly
in my documentation, taking advantage of Babel to insert the R output
and graphics right into it.  It gets especially interesting because of R
sessions within Org, which may be used to cache prior computation
results, yielding comfortable interaction speed.  Also, despite hundreds
of included graphics already, I do not feel any slowdown in Emacs yet.

I think I'm going to just love it! :-)  Thanks to all contributors!


There are tiny improvements or questions which I would like to discuss,
however.  As this is all new and a bit overwhelming for me, I apologize
if my reports are a bit fuzzy, I guess dust should settle as days pass,
and would likely develop a clearer understanding with time.

One thing is that I very often have to do "C-c C-x C-v C-c C-x C-v",
that is that I toggle in-lining of images out and in.  It seems that
whenever I save the file, or use "C-c C-c" within an R Babel block, the
images stop being in-lined, while the in-line image flag is not reset.
Ideally, saving a file should not hide in-lined images.  If, for some
technical reason, this is unavoidable, then at least, the in-line image
flag should always tell the truth, so "C-c C-x C-v" would be sufficient
to recall back the images.

Real fun would be that any "C-c C-c" which triggers the re-computation
of an already displayed graphics, merely gets the displayed graphics to
get updated in place, without any more special interaction needed to
re-in-line it.

Another point which gave me some fight to do is the disappearing of
column and row headers in non-graphical output.  I only get the raw data
of the results.  I found it quite annoying with R table() output, for
example, which are rather meaningless with no titles at all.  Currently,
the only reasonable solution I have is to use ":results output org",
combined with an ascii() call on the R side, once ascii configured to
create Org style output (quite a nice feature, should I say!).  Yet, it
would be all nicer and cleaner if none of this extra machinery was

A very minor point is that, within a #+BEGIN_ORG / #+END_ORG block, I
sometimes see an extraneous space at the very beginning, before the
first "|".  Sometimes I do not see it, and output is perfect.  I'll try
to find some coincidence with other things, that would allow to
hypothesize a cause.  Or else, to reproduce the problem with data which
is public enough that I could share it.

I call it a day for now and get some sleep :-).

With enough luck, will find some time to revisit this tomorrow.  Yet
before leaving today, I wanted to say and share my enthusiasm for this
Org Babel / R combination, and also report the tiny problems above.

Keep happy, all!


             reply	other threads:[~2012-07-16  3:44 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-07-16  3:44 François Pinard [this message]
2012-07-16  6:37 ` Discovering Babel and R combination! Thomas S. Dye
2012-07-16 13:57   ` François Pinard
2012-07-21 10:55 ` Ippei FURUHASHI

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=86d33w74ke.fsf@mercure.progiciels-bpi.ca \
    --to=pinard@iro.umontreal.ca \
    --cc=emacs-orgmode@gnu.org \


* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox


This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).