emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Nick Dokos <nicholas.dokos@hp.com>
To: "Thomas S. Dye" <tsd@tsdye.com>
Cc: nicholas.dokos@hp.com, Org-mode <emacs-orgmode@gnu.org>
Subject: Re: Bug passing tables to R code blocks?
Date: Mon, 17 Oct 2011 22:45:43 -0400	[thread overview]
Message-ID: <6364.1318905943@alphaville.dokosmarshall.org> (raw)
In-Reply-To: Message from tsd@tsdye.com (Thomas S. Dye) of "Mon, 17 Oct 2011 16:05:01 -1000." <m1aa8zf41e.fsf@tsdye.com>

Thomas S. Dye <tsd@tsdye.com> wrote:

> Aloha all,
> 
> I'm seeing some unexpected behavior when passing two tables into an R
> source code block.  Things seem to work as expected when only one table is
> passed. 
> 
> In the following example, the header for the second table ends up on the
> first table when I evaluate the source code block.
> 
> * R tables
> 
> #+TBLNAME: tbl-1
> | column1 | column2 |
> |---------+---------|
> |      45 |      34 |
> |      77 |      56 |
> 
> #+tblname: tbl-2
> | col1 | col2 |
> |------+------|
> | a    | b    |
> | c    | d    |
> 
> #+BEGIN_SRC R :var x=tbl-1 :var y=tbl-2 :colnames yes
> x
> #+END_SRC
> 
> #+results:
> | col1 | col2 |
> |------+------|
> |   45 |   34 |
> |   77 |   56 |
> 
> release_7.7-396-g3538
> Org-mode version 7.7 (release_7.7.396.g3538)
> 
> Bug?  Or my setup?
> 

Bug, I think: org-babel-disassemble-tables goes over tables from left to
right (top to bottom) but conses colnames (and rownames) to the front,
so they come out backwards. Reversing those two lists just before
org-babel-disassemble-tables returns should fix it.

Nick

  reply	other threads:[~2011-10-18  2:45 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-10-18  2:05 Bug passing tables to R code blocks? Thomas S. Dye
2011-10-18  2:45 ` Nick Dokos [this message]
2011-10-18 16:09   ` Eric Schulte
2011-10-18 18:44     ` Thomas S. Dye

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=6364.1318905943@alphaville.dokosmarshall.org \
    --to=nicholas.dokos@hp.com \
    --cc=emacs-orgmode@gnu.org \
    --cc=tsd@tsdye.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).