From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Charles C. Berry" Subject: Re: R code block produces only partial output Date: Tue, 5 Aug 2014 15:21:58 -0700 Message-ID: References: <87iom8zd24.fsf@gmail.com> <877g2oz9gv.fsf@gmail.com> <87lhr27oap.fsf@gmail.com> Mime-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:43068) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XEn9i-0006t0-8U for emacs-orgmode@gnu.org; Tue, 05 Aug 2014 18:24:36 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XEn9c-0008B0-99 for emacs-orgmode@gnu.org; Tue, 05 Aug 2014 18:24:30 -0400 Received: from iport-acv1-out.ucsd.edu ([132.239.0.176]:20894) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XEn9c-0008Ah-0W for emacs-orgmode@gnu.org; Tue, 05 Aug 2014 18:24:24 -0400 In-Reply-To: List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: John Hendy Cc: emacs-orgmode , Eric Schulte On Tue, 5 Aug 2014, John Hendy wrote: > On Tue, Aug 5, 2014 at 2:02 PM, Eric Schulte wrote: >> Charles Berry writes: >> >>> Eric Schulte 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