emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [O] R code block produces only partial output


From: Charles C. Berry
Subject: Re: [O] R code block produces only partial output
Date: Tue, 5 Aug 2014 15:21:58 -0700
User-agent: Alpine 2.00 (OSX 1167 2008-08-23)

On Tue, 5 Aug 2014, John Hendy wrote:

On Tue, Aug 5, 2014 at 2:02 PM, Eric Schulte <address@hidden> wrote:
Charles Berry <address@hidden> writes:

Eric Schulte <schulte.eric <at> gmail.com> writes:

[snip]

Eric,

As noted by Andreas and John this is a problem for session output.

org-babel-R-evaluate-session uses

 (string-match "^\\([ ]*[>+\\.][ ]?\\)+\\([[0-9]+\\|[ ]\\)" line)

to find the start of R output in the session.

This does not match the `          0', but matches the `         .6'
in the output you show above, so if that had been in a session, all the
output up to and including the '.' before the '6' would be clipped
by the following

  (substring line (match-end 1))


as Andreas output showed.

Deleting the "\\." fixes Andreas case, but what are the circumstances
requiring the  "\\." ?


I don't know.

I'm not sure either, but was curious if someone could translate the
regex into "plain language." Maybe I could observe some typical
outputs and chime in since I use R regularly? From noob-level regex
stuff, it's looking for a new line followed by some number of spaces,
a ">" and at least one period and numbers?



One of > or + or . and then some more.

You can get the 'English' at

        http://www.myezapp.com/apps/dev/regexp/show.ws


But a better approach IMO is to open an R transcript, then M-x regex-builder and paste that regex into the window in place of the "". The matches should highlight.

Or use M-x occur (and edit the string to rid quotes and extra backslashes). But that will not show what you are missing.

Chuck




reply via email to

[Prev in Thread] Current Thread [Next in Thread]