From mboxrd@z Thu Jan 1 00:00:00 1970 From: Thierry Banel Subject: Re: extract a column from a table but but an name on the new table Date: Sun, 27 May 2018 15:06:48 +0200 Message-ID: <5B0AAD68.9010007@free.fr> References: <87y3g9fbfu.fsf@mat.ucm.es> <5B090AC5.3060607@free.fr> <87zi0molzv.fsf@mat.ucm.es> Mime-Version: 1.0 Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:49147) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fMvNr-0006v8-2l for emacs-orgmode@gnu.org; Sun, 27 May 2018 09:06:51 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fMvNq-0000Vx-7f for emacs-orgmode@gnu.org; Sun, 27 May 2018 09:06:51 -0400 Received: from smtp2-g21.free.fr ([2a01:e0c:1:1599::11]:20802) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1fMvNq-0000UM-0w for emacs-orgmode@gnu.org; Sun, 27 May 2018 09:06:50 -0400 Received: from [IPv6:2a01:e35:2e21:def0:c0c:c063:94d:ca73] (unknown [IPv6:2a01:e35:2e21:def0:c0c:c063:94d:ca73]) by smtp2-g21.free.fr (Postfix) with ESMTP id 5ECC82003A8 for ; Sun, 27 May 2018 15:06:48 +0200 (CEST) In-Reply-To: <87zi0molzv.fsf@mat.ucm.es> 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" To: emacs-orgmode@gnu.org On 26/05/2018 10:32, Uwe Brauer wrote: > > > > You may name the Lisp block like that: > > > -------------------------------------- > > > #+TBLNAME: raw-data > > | 1 | a | 3 | > > | 2 | b | 4 | > > | 3 | c | 6 | > > | 4 | d | 7 | > > > Thank you! > > BTW I found it strange that the extracting function does not exist in > vanilla org. You may like the out-of-the-boxtable remote references: | 3 | | 4 | | 6 | | 7 | | | | | #+TBLFM: $1=remote(raw-data,@@#$3) The downside is that you need to create an empty table with the right size before filling it with C-u C-c * > > My situation is a bit different, since I later want to use R. > > So I have > > > #+TBLNAME: raw-data > | 1 | a | 3 | > | 2 | b | 4 | > | 3 | c | 6 | > | 4 | d | 7 | > > #+NAME: NotasA > #+BEGIN_SRC elisp :var data=raw-data > (mapcar (lambda (line) > (list (nth 2 line))) > data) > #+END_SRC > > #+RESULTS: NotasA > | 3 | > | 4 | > | 6 | > | 7 | > > > > #+begin_src R :var notasA=notasA > summary(notasA) > #+end_src > > And the last call does not work. It seems that R needs a table name..... > > Uwe > I get a result. Maybe you used downcase "notasA" where uppercase "NotasA" was expected? #+begin_src R :var notasA=NotasA summary(notasA) #+end_src #+RESULTS: | Min. :3.00 | | 1st Qu.:3.75 | | Median :5.00 | | Mean :5.00 | | 3rd Qu.:6.25 | | Max. :7.00 |