From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andreas Leha Subject: BUG: table variable passing broken Date: Fri, 05 Dec 2014 13:25:38 +0000 Message-ID: Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:34451) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XwstK-0007VG-8m for emacs-orgmode@gnu.org; Fri, 05 Dec 2014 08:25:58 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Xwst8-0006fn-4N for emacs-orgmode@gnu.org; Fri, 05 Dec 2014 08:25:45 -0500 Received: from plane.gmane.org ([80.91.229.3]:33900) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Xwst7-0006fY-Ph for emacs-orgmode@gnu.org; Fri, 05 Dec 2014 08:25:38 -0500 Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1Xwst6-00067O-6D for emacs-orgmode@gnu.org; Fri, 05 Dec 2014 14:25:36 +0100 Received: from 193.63.222.11 ([193.63.222.11]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 05 Dec 2014 14:25:36 +0100 Received: from andreas.leha by 193.63.222.11 with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 05 Dec 2014 14:25:36 +0100 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, This issue is still open. And I do not seem to be able to find this thread on gmane for some reason. So, I resend the last message as a summary. EDIT: I just tried to answer to that thread but the message again did not come through. So, another try (with a slightly adapted title). Best, Andreas Andreas Leha writes: >> Charles Berry writes: >>> Andreas Leha med.uni-goettingen.de> writes: >>> >>>>=20 >>>> Hi all, >>>>=20 >>>> There seems to be a bug in table passing as variables now using the >>>> tangle-friendly version of passing variables. >>>>=20 >>>> Here is an example (I get an error also with emacs -Q): >>>>=20 >>>> --8<---------------cut here---------------start------------->8--- >>>> * test >>>> #+name: testtab >>>> | variable | display | unit | >>>> |-----------------------+-------------------------------+-------| >>>> | num_cells | Number of Cells in Well | | >>>> | cell_area | Cell Area | =CE=BCm=C2=B2= > | >>>> | nucleus_area | Nucleus Area | =CE=BCm=C2=B2= > | >>>> | roundness | Cell Roundness | | >>>> | ratio_w2l | Cell Width to Length Ratio | | >>>> | inten_nuc_dapi_median | Intensity Nucleus DAPI Median | | >>>> | dapi_median | Intensity Nucleus DAPI Median | | >>>> | edu_median | Intensity edu Median | | >>>> | oct4_median | Intensity oct4 Median | | >>>> | clump_size | Clump Size | cells | >>>> | short_name | Cell Line | | >>>> | p_col | Column | | >>>> | batch | Batch | | >>>> | concentration | Fibronectin Concentration | ugml | >>>> | Residual | Residual | | >>>> | evaluation_guid | Plate | | >>>> | donor | Genotype | | >>>>=20 >>>> #+BEGIN_SRC R :session *test* :var test=3Dtesttab >>>> test >>>> #+END_SRC >>>>=20 >>>> #+RESULTS: >>>> --8<---------------cut here---------------end--------------->8--- >>>>=20 >>>> I see this in my R session: >>>>=20 >>>> --8<---------------cut here---------------start------------->8--- >>>> Error in scan(file, what, nmax, sep, dec, quote, skip, nlines,=20 >>>> na.strings, (from >>>> testorg.org!917613Wp#22) :=20 >>>> line 17 did not have 3 elements >>>> --8<---------------cut here---------------end--------------->8--- >>>>=20 >>> >>> I think this is the wrong diagnosis. >> >> I agree. Saving the table as tsv (via org-table-export) results >> in a file that cannot be read from R either. >> >>> >>> Did you actually revert to the earlier version of ob-R.el to confirm tha= >t=20 >>> this would have run correctly?=20 >> >> I did not revert. But that org file used to work. I won't be able >> to bisect any time soon. >> >>> >>> The reason I ask is that I just tried this with org-babel-R-assign-elisp >>> from=20 >>> >>> org-mode-a5686d87786b1d6514ec85959a2188f703346a06/lisp/ob-R.el >>> >>> and got the same error. Note this: >>> >>> >>> #+name: testtab2 >>> | variable | display | unit | >>> |----------+----------+------| >>> | donor | Genotype | | >>> >>>=20=20=20 >>> #+BEGIN_SRC emacs-lisp :var test=3Dtesttab2 >>> (orgtbl-to-tsv test '(:fmt org-babel-R-quote-tsv-field)) >>> #+END_SRC >>> >>> #+RESULTS: >>> : "donor" "Genotype" >>> >> >> exactly. That also causes the org-table-export to fail. >> >>> >>> #+BEGIN_SRC emacs-lisp :var value=3Dtesttab2 >>> ;; from org-babel-R-assign-elisp >>> (mapcar 'length (org-remove-if-not 'sequencep value)) >>> #+END_SRC >>> >>> #+RESULTS: >>> | 3 | >>> >>> In particular, the empty table cells are omitted even though=20 >>> >>> `value' or `test' has all lengths as 3. This results in=20 >>> calling read.table ( ..., fill=3DFALSE) implicitly. >>> >>> Not sure if the fix is to retool org-babel-R-assign-elisp or something >>> in org-table.el. >>> >> >> I am the wrong person to answer that. But it looks to me to be an >> issue for org-table.el. >> >> Thanks for your better analysis. >> >> Regards, >> Andreas > >To keep this issue going, here a quick thought: > >Since orgtbl-to-csv seems to work, a temporary fix on ob-R's side would >be to use that for passing of tables. > >Andreas >