From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andreas Leha Subject: Re: bug: orgtbl-to-tsv: premature end of table Date: Thu, 23 Jul 2015 10:13:14 +0100 Message-ID: References: <87h9ovzug3.fsf@nicolasgoaziou.fr> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:46375) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZICZE-0006w3-5h for emacs-orgmode@gnu.org; Thu, 23 Jul 2015 05:13:29 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZICZA-0003Nc-UB for emacs-orgmode@gnu.org; Thu, 23 Jul 2015 05:13:28 -0400 Received: from plane.gmane.org ([80.91.229.3]:49451) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZICZA-0003MU-Na for emacs-orgmode@gnu.org; Thu, 23 Jul 2015 05:13:24 -0400 Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1ZICZ7-0008Bj-Lj for emacs-orgmode@gnu.org; Thu, 23 Jul 2015 11:13:21 +0200 Received: from 193.63.223.184 ([193.63.223.184]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 23 Jul 2015 11:13:21 +0200 Received: from andreas.leha by 193.63.223.184 with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 23 Jul 2015 11:13:21 +0200 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: emacs-orgmode@gnu.org Hi all, "Charles C. Berry" writes: > On Wed, 22 Jul 2015, Nicolas Goaziou wrote: > >> Hello, >> >> "Charles C. Berry" writes: >> >>> Not a bug IMO. >> >> Notwithstanding the R issue, I think trimming the output of a radio >> table is a bit aggressive. We cannot know if trailing (and leading) >> spaces are significant in the output format the user defined. >> >> I removed the trimming part in commit >> bf37cd09b128b4431e1dd1a538fbcc4be3615042. >> >> Let me know if you disagree with that change. > > I don't think the change broke anything that wasn't already broken. > > And my diagnosis was wrong - I was confused by a problem that remains: > > `org-babel-R-assign-elisp' is broken. Ragged rows in a table are filled > with "" in each missing field; `org-table-to-lisp' returns a list of lists > of common length. > > `org-babel-R-assign-elisp' inspects that list to see if any element vary > in length. But they do not, and therefore `max' and `min' in the let* > varlist are equal and later on `ob-R-transfer-variable-table-with-header' > is always used. > > I think lom pik's example would not have failed had max and min differed > as `ob-R-transfer-variable-table-without-header' would have been used > instead. > > R src blocks ought to render missing elements due to ragged rows in a > table as NA, but this isnt the current behavior for this table: > > #+NAME: tbl-ragged > | 1 | 2 | a | > > | 8 | 9 | | > > It seems like the fix for this would be to prune any "" at the ends of > lists in the value arg when beginning `org-babel-R-assign-elisp'. > > But I am tired, so I'll defer trying this till another time. > > Best, > > Chuck Thank you all for looking into this. I have seen this as well and the manual work-around (to put sth into the last cell) was getting really annoying -- especially if the table was auto-generated by sth else. While looking at handling tables, could I suggest to switch to csv instead of tsv for the table passing? I still see issues with tables not separated. (This happens only in preview (C-c C-v v) and not when executing the block.) I never had time to track this down, but I get caught now and then. Using csv should be more robust in this regard. Thanks, Andreas