From mboxrd@z Thu Jan 1 00:00:00 1970 From: Rainer M Krug Subject: Re: [BABEL] Define tables with names in org? Date: Thu, 09 Jan 2014 14:56:06 +0100 Message-ID: <52CEAA76.2090901@krugs.de> References: <52CE89A9.8060305@krugs.de> Reply-To: Rainer@krugs.de Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:36229) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W1G5n-0001QC-RO for emacs-orgmode@gnu.org; Thu, 09 Jan 2014 08:56:21 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1W1G5i-0004wn-AY for emacs-orgmode@gnu.org; Thu, 09 Jan 2014 08:56:15 -0500 Received: from mail-wi0-f179.google.com ([209.85.212.179]:49644) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W1G5i-0004wc-4V for emacs-orgmode@gnu.org; Thu, 09 Jan 2014 08:56:10 -0500 Received: by mail-wi0-f179.google.com with SMTP id z2so3495933wiv.0 for ; Thu, 09 Jan 2014 05:56:09 -0800 (PST) In-Reply-To: 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: Christian Moe Cc: emacs-orgmode -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On 01/09/14, 13:30 , Christian Moe wrote: > > Rainer M Krug writes: > >> I would like to define a table with named columns and rows, so >> that the table is passed to R including the column and row names >> - is this possible? > > Yes, just use the leftmost column for row names and include the > header argument :rownames yes. > > By default, the first row will be used for column names if followed > by a hline. Without a hline, use :colnames yes. > > E.g.: > > #+name: colrownamestbl | | Alpha | Beta | Gamma | > |--------+-------+------+-------| | First | A1 | B1 | C1 > | | Second | A2 | B2 | C2 | | Third | A3 | B3 | C3 > | > > #+begin_src R :var data=colrownamestbl :rownames yes :results > output colnames(data) rownames(data) #+end_src > > #+RESULTS: : [1] "Alpha" "Beta" "Gamma" : [1] "First" "Second" > "Third" Ah - I see. Nice. Thanks. One problem though: I define my variables in the beginning of the document, in a not exported heading so that they don't show in the report, and I want to have some variables with rownames and some without. Is this possible? * INTERNAL VARIABLES :noexport: ** Without column names #+NAME: WITHCOLNAMES | name | |---------------| | NPPyC | | DBBVy | | DBRFy | | DBSSy | | levelstress_2 | #+PROPERTY: var+ WITHCOLNAMES=WITHCOLNAMES ** Without column names #+NAME: COLS_TO_EVAL | name | |---------------| | NPPyC | | DBBVy | | DBRFy | | DBSSy | | levelstress_2 | #+PROPERTY: var+ COLS_TO_EVAL=COLS_TO_EVAL And this should be valid everywhere where I use WITHCOLNAMES and WITHOUTCOLNAMES in R without having to specify :rownames true each time? Rainer > > Yours, Christian > - -- Rainer M. Krug, PhD (Conservation Ecology, SUN), MSc (Conservation Biology, UCT), Dipl. Phys. (Germany) Centre of Excellence for Invasion Biology Stellenbosch University South Africa Tel : +33 - (0)9 53 10 27 44 Cell: +33 - (0)6 85 62 59 98 Fax : +33 - (0)9 58 10 27 44 Fax (D): +49 - (0)3 21 21 25 22 44 email: Rainer@krugs.de Skype: RMkrug -----BEGIN PGP SIGNATURE----- Version: GnuPG/MacGPG2 v2.0.22 (Darwin) Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQEcBAEBAgAGBQJSzqp2AAoJENvXNx4PUvmCHqIH/jleiTYI2JhkMRW4d6B7jepF WzbGM4kdCasUPuK7KPKf5eqF/l03SMzvscH7tR3nfDxw9BO7J+r8BwO3U9U2h7+E vu/bTyevqNdLmT1RZGj2fXET6vSM3iLp2uTnC21oqc0AX769HknxoRAycTbD2I3a IKY2S0DHiJfc+wKfzcnRZja7zwIVY6FgyYuD2L3+HYqBDuff0KG+LK3xWh0xAll2 8ldeaQZEB77rzBkehuazDtrAAkuF+r8kfu3d78eY1C5mZ0Vfu5N18QqyHN+UDqtW fpvJbZVPZQdIiIMrNqsfaJvXRkGZUaX9+LW2FdTE92dW3L4mQxcu47O3WMPpNUs= =/iwa -----END PGP SIGNATURE-----