From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andreas Leha Subject: [babel] problem with colnames Date: Tue, 08 May 2012 20:55:31 +0200 Message-ID: <87r4uu33ks.fsf@med.uni-goettingen.de> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([208.118.235.92]:44218) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SRpaF-0005ha-5C for emacs-orgmode@gnu.org; Tue, 08 May 2012 14:56:28 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SRpaC-0000qq-C0 for emacs-orgmode@gnu.org; Tue, 08 May 2012 14:56:26 -0400 Received: from plane.gmane.org ([80.91.229.3]:43151) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SRpaC-0000qd-5W for emacs-orgmode@gnu.org; Tue, 08 May 2012 14:56:24 -0400 Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1SRpa9-0006wX-TB for emacs-orgmode@gnu.org; Tue, 08 May 2012 20:56:21 +0200 Received: from vpn-2130.gwdg.de ([134.76.2.130]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 08 May 2012 20:56:21 +0200 Received: from andreas.leha by vpn-2130.gwdg.de with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 08 May 2012 20:56:21 +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 Hi all, I have a question regarding colnames in babel source blocks. Suppose, I have a source block (in R) that has as input a table and returns a table. And I would like to have the resulting table with column names, but the input table does not have column names. How can I achieve this? Here is an example: The input table #+name: intab | bla | | blu | By default, the colnames are stripped off the result: #+begin_src R :var intab=intab colnames(intab) <- "rara" intab #+end_src #+results: | bla | | blu | The same happens when setting :colnames no #+begin_src R :var intab=intab :colnames no colnames(intab) <- "rara" intab #+end_src #+results: | bla | | blu | Setting :colnames yes strips the first row from the input: #+begin_src R :var intab=intab :colnames yes colnames(intab) <- "rara" intab #+end_src #+results: | rara | |------| | blu | Finally, setting :colnames nil also strips the first row from the input: #+begin_src R :var intab=intab :colnames nil colnames(intab) <- "rara" intab #+end_src #+results: | rara | |------| | blu | Regards, Andreas