From mboxrd@z Thu Jan 1 00:00:00 1970 From: Rainer M Krug Subject: Re: [babel, bug?] colnames with a list of columns does not work Date: Fri, 23 Jan 2015 12:13:27 +0100 Message-ID: References: <86zj9bytg4.fsf@example.com> <86d265pyxa.fsf@example.com> 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]:50505) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YEcBZ-0006Sr-Hx for emacs-orgmode@gnu.org; Fri, 23 Jan 2015 06:13:58 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YEcBV-0007Hd-UH for emacs-orgmode@gnu.org; Fri, 23 Jan 2015 06:13:57 -0500 Received: from plane.gmane.org ([80.91.229.3]:36083) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YEcBV-0007HB-JC for emacs-orgmode@gnu.org; Fri, 23 Jan 2015 06:13:53 -0500 Received: from public by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1YEcBU-0005OH-3R for emacs-orgmode@gnu.org; Fri, 23 Jan 2015 12:13:52 +0100 In-Reply-To: <86d265pyxa.fsf@example.com> (Sebastien Vauban's message of "Fri, 23 Jan 2015 11:35:29 +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: Sebastien Vauban Cc: public-emacs-orgmode-mXXj517/zsQ@plane.gmane.org --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Sebastien Vauban writes: > Hello Thomas and Rainer, > > Rainer M Krug wrote: >> Sebastien Vauban writes: >>> >>> #+begin_src R :rownames yes :colnames '(Lg Nb) >>> data(iris) >>> head(table(iris$Petal.Length, iris$Species)[, "setosa"], n=3D2) >>> #+end_src >>> >>> returns: >>> >>> | | x | >>> |-----+----| >>> | 1 | 1 | >>> | 1.1 | 1 | >>> >>> while I was expecting: >>> >>> | Lg | Nb | >>> |-----+----| >>> | 1 | 1 | >>> | 1.1 | 1 | >> >> WHy should it? The org-info manual states: >> >> ,---- >> | The `:colnames' header argument accepts the values `yes', `no', or >> | `nil' for unassigned. The default value is `nil'. Note that the >> | behavior of the `:colnames' header argument may differ across >> | languages.=20 >> `---- >> >> It says nothing about accepting any other values. >> Unless I am missing something? > > Yes, you just show that the documentation is not up-to-date, as that > functionality *is* implemented for most languages. Ups - wasn't aware of this. Cheers, Rainer > > Doing some bit of archeology, I just found out that: > > - Eric wrote a patch to support the above (but it hasn't be applied), > > - I (!) even wrote a test of that functionality (for a shell block) in > `testing/lisp/test-ob.el'. > > See https://lists.gnu.org/archive/html/emacs-orgmode/2013-04/msg00527.htm= l: > > =E2=94=8C=E2=94=80=E2=94=80=E2=94=80=E2=94=80 > =E2=94=82 It looks like ob-R implements its own result table reconstruc= tion > =E2=94=82 instead of using the general support. This is because R actu= ally > =E2=94=82 has a notion of column names and row names internally. The > =E2=94=82 implementation in ob-R does not correctly handle specified co= lnames > =E2=94=82 as your example shows. > =E2=94=82=20 > =E2=94=82 The attached patch brings ob-R closer to the using the unified > =E2=94=82 general table reconstructed used in most other languages, and= fixes > =E2=94=82 your problem mentioned above. I haven't applied it however, = as it > =E2=94=82 may introduce other bugs related to specifying column names f= rom > =E2=94=82 within R. For example, I'm not sure that it will now correct= ly > =E2=94=82 apply column names from a table built entirely from within R. > =E2=94=82=20 > =E2=94=82 Additional testing by someone more familiar with R than mysel= f would > =E2=94=82 be greatly appreciated. > =E2=94=94=E2=94=80=E2=94=80=E2=94=80=E2=94=80 > > Should such someone (more familiar with R) be able to confirm that his > patch work without introducing problems, it could be applied so that > R should behave the same as in most languages... > > Best regards, > Seb =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) iQEcBAEBAgAGBQJUwizcAAoJENvXNx4PUvmCvZoH/1dJOqv9mEWUq8DoOJZHt0BL h0FKMysZnm+p1K+k//V70t/Jraqps7djr/F+S6GeLRInF0wLDBYMYoG9U0NFpIyE u3JmZdi8Bpzwn5G1ndVjve5cefXQ9XHlZc2pw27nh1aNaw1DdWykb4vK1zD6+ChM oGIuwqfHm72uPZ3UkciZno4vn8sDiYi1x6bawinXgWJq8qLownPQVpo+5UGfXHj1 wZpctAg9UgvxdXhdVOFtl35J3drLqCmB3qoq/UFcbvGyPsfbDjke36obwbzNKlNx uI7a2sT8m3tf0EvUP4hP1HExg1/8d5vVExUS8ZtB3RK9XhUnFZSn9wFLp45siko= =3cg9 -----END PGP SIGNATURE----- --=-=-=--