From mboxrd@z Thu Jan 1 00:00:00 1970 From: Charles Berry Subject: Re: [ob-R] table variable passing broken Date: Tue, 14 Oct 2014 16:36:01 +0000 (UTC) Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:50763) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Xe55H-0000CB-97 for emacs-orgmode@gnu.org; Tue, 14 Oct 2014 12:36:33 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Xe55B-0005Ni-5H for emacs-orgmode@gnu.org; Tue, 14 Oct 2014 12:36:27 -0400 Received: from plane.gmane.org ([80.91.229.3]:56940) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Xe55A-0005Ne-UN for emacs-orgmode@gnu.org; Tue, 14 Oct 2014 12:36:21 -0400 Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1Xe556-0001ZP-Ip for emacs-orgmode@gnu.org; Tue, 14 Oct 2014 18:36:16 +0200 Received: from 137.110.39.109 ([137.110.39.109]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 14 Oct 2014 18:36:16 +0200 Received: from ccberry by 137.110.39.109 with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 14 Oct 2014 18:36:16 +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 Andreas Leha med.uni-goettingen.de> writes: > > Hi all, > > There seems to be a bug in table passing as variables now using the > tangle-friendly version of passing variables. > > Here is an example (I get an error also with emacs -Q): > > --8<---------------cut here---------------start------------->8--- > * test > #+name: testtab > | variable | display | unit | > |-----------------------+-------------------------------+-------| > | num_cells | Number of Cells in Well | | > | cell_area | Cell Area | μm² | > | nucleus_area | Nucleus Area | μm² | > | 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 | | > > #+BEGIN_SRC R :session *test* :var test=testtab > test > #+END_SRC > > #+RESULTS: > --8<---------------cut here---------------end--------------->8--- > > I see this in my R session: > > --8<---------------cut here---------------start------------->8--- > Error in scan(file, what, nmax, sep, dec, quote, skip, nlines, > na.strings, (from > testorg.org!917613Wp#22) : > line 17 did not have 3 elements > --8<---------------cut here---------------end--------------->8--- > I think this is the wrong diagnosis. Did you actually revert to the earlier version of ob-R.el to confirm that this would have run correctly? The reason I ask is that I just tried this with org-babel-R-assign-elisp from org-mode-a5686d87786b1d6514ec85959a2188f703346a06/lisp/ob-R.el and got the same error. Note this: --8<---------------cut here---------------start------------->8--- #+name: testtab2 | variable | display | unit | |----------+----------+------| | donor | Genotype | | #+BEGIN_SRC emacs-lisp :var test=testtab2 (orgtbl-to-tsv test '(:fmt org-babel-R-quote-tsv-field)) #+END_SRC #+RESULTS: : "donor" "Genotype" #+BEGIN_SRC emacs-lisp :var value=testtab2 ;; from org-babel-R-assign-elisp (mapcar 'length (org-remove-if-not 'sequencep value)) #+END_SRC #+RESULTS: | 3 | --8<---------------cut here---------------end--------------->8--- In particular, the empty table cells are omitted even though `value' or `test' has all lengths as 3. This results in calling read.table ( ..., fill=FALSE) implicitly. Not sure if the fix is to retool org-babel-R-assign-elisp or something in org-table.el. HTH, Chuck