From mboxrd@z Thu Jan 1 00:00:00 1970 From: Rainer M Krug Subject: Re: [BUG] [babel] [R] :colnames yes conflicts with :results file Date: Wed, 07 Jan 2015 10:11:58 +0100 Message-ID: References: Mime-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha1; protocol="application/pgp-signature" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:56544) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Y8s0x-0004dN-22 for emacs-orgmode@gnu.org; Wed, 07 Jan 2015 09:55:16 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Y8s0s-0000Th-1w for emacs-orgmode@gnu.org; Wed, 07 Jan 2015 09:55:14 -0500 Received: from mail-wg0-f45.google.com ([74.125.82.45]:41914) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Y8s0r-0000Tb-QI for emacs-orgmode@gnu.org; Wed, 07 Jan 2015 09:55:10 -0500 Received: by mail-wg0-f45.google.com with SMTP id b13so1312098wgh.32 for ; Wed, 07 Jan 2015 06:55:09 -0800 (PST) In-Reply-To: (Andreas Leha's message of "Tue, 06 Jan 2015 15:39:41 +0000") 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: Andreas Leha Cc: emacs-orgmode@gnu.org --=-=-= Content-Type: text/plain Content-Transfer-Encoding: quoted-printable Andreas Leha writes: > Hi Rainer, > > Thanks for following up on this. > > Rainer M Krug writes: >> Andreas Leha writes: >> >>> Hi all, >> >> Hi >> >>> >>> There seems to be a bug in babel (at least for R) when it comes to >>> source blocks producing file links but taking tables with headers. In >>> that case, ':colnames yes' disables the ':results file' directive. >> >> I don't think this is a bug as it is not clear what should happen. > > I disagree. I consider it a bug because it is a functional limitation. > If I see it correctly, there is no way to generate a file link when > passing a table with header. > > I'd expect the :colnames yes to take effect only if there is actually a > table. If that was the behaviour, then there would be no functional > limitation of that kind. OK - I see your point. I was only thinking of the R -> org side, but :colnames yes also refers to the input side. So if I understand you correctly, you want org -> R tables with header as variables R -> org link to file Is this correct? In this case, I agree completely - this is a bug. > > >> In the org manual it states concerning the :results file >> >> ,---- >> | * `file' The results will be interpreted as the path to a file, and >> | will be inserted into the Org mode buffer as a file link. E.g., >> | `:results value file'.=20 >> `---- >> >> But the :colnames only works on tables (i.e. :results table) - but the >> result is represented as a link to a file. So what should happen? > > Well, I think -- as you say -- :colnames works only on tables. Since > there is no table (more than that, actually: I specifically do *not > want* a table), the :colnames should not apply. Agree completely. > > I ask org to produce a file link but get a table. For me that clearly > is unexpected. > +1 >> >> If you would like to have a table with links to files, the easiest is to >> put the file names into [[]] in R and then return them in a table - or >> use :results output and "draw" the table. > > Exactly. > >> >> But as it stands, these two header arguments do not go together. >> >> It would be nice to have a warning (or even error) in org, or at least a >> table of header argument precedence. > > I'd say a warning does not fix this. As I might need ':colnames yes' > for an input table and ':results file' for the output. So if the results type is defined, :results determines the type of the retu= rned value, and only if it is a table, the :colnames header argument should be used. > > > At least that is my view. Your view is correct. Cheers, Rainer > > Thanks, > Andreas > > >> >> By the way - never used the :results file - but now I will! Thanks. >> >> Hope this helps, >> >> Rainer >> >> >>> >>> Here is the Cm: >>> * test >>> >>> #+BEGIN_SRC R :results file replace >>> "some_file.csv" >>> #+END_SRC >>> >>> #+RESULTS: >>> [[file:some_file.csv]] >>> >>> #+BEGIN_SRC R :colnames yes :results file replace >>> "some_file.csv" >>> #+END_SRC >>> >>> #+RESULTS: >>> | x | >>> |---------------| >>> | some_file.csv | >>> >>> >>> >>> * My Setup >>> #+begin_src emacs-lisp >>> (concat >>> (replace-regexp-in-string " on .*" "" (emacs-version)) >>> "\n" >>> (replace-regexp-in-string " @.*" ")" (org-version nil t)) >>> "\n" >>> (replace-regexp-in-string "].*" "]" (ess-version))) >>> #+end_src >>> >>> #+RESULTS: >>> : GNU Emacs 24.4.50.1 (x86_64-apple-darwin13.3.0, NS appkit-1265.21 Ver= sion 10.9.4 (Build 13E28)) >>> : of 2014-09-02 >>> : Org-mode version 8.3beta (release_8.3beta-717-ga8096c) >>> : ess-version: 14.05 [git: 4283f1304a54502c42707b6a4ba347703f0992dd] >>> >>> Regards, >>> Andreas >>> >>> >>> > > > =2D-=20 Rainer M. Krug email: Rainerkrugsde PGP: 0x0F52F982 --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG/MacGPG2 v2.0.22 (Darwin) iQEcBAEBAgAGBQJUrPhiAAoJENvXNx4PUvmCt+4IAKJUlbisZ80a1RE0ndSY4yWN TqSCvdgCE4WRwl4biAE4erDYhqVPOz4ksqMfT1nDnO+SPpB6rTPsURhx5C8Eq7EM 2cVPT+piBTyJZWznmZ45SNR1I6lDAxWkNlrehG+uFwQk7mnfDm3SDl+eHxJVIAMq JkY2DKdPupKOIpDnZlTf/90D0RxXRjx/9hqaMw4/3YCjvzFvF2J2m1yZh0KSBmqP lPMG552gZbnTXaMZ0fX0y+MfQn5TLntO5iyaMdKu6nHY/U9zF8C/N2IdkpJv0+aQ fOLOZSy/LLWt7Kj1YNFJry9OMOTiy2qtBA2gUR1fq3FJdYw7JRhyoRZa7LlUtEA= =NlW+ -----END PGP SIGNATURE----- --=-=-=--