From: Eric Schulte <schulte.eric@gmail.com>
To: nicholas.dokos@hp.com
Cc: Org-mode <emacs-orgmode@gnu.org>
Subject: Re: Bug passing tables to R code blocks?
Date: Tue, 18 Oct 2011 10:09:42 -0600 [thread overview]
Message-ID: <87r52a2se1.fsf@gmail.com> (raw)
In-Reply-To: <6364.1318905943@alphaville.dokosmarshall.org> (Nick Dokos's message of "Mon, 17 Oct 2011 22:45:43 -0400")
Nick Dokos <nicholas.dokos@hp.com> writes:
> 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, thanks for diagnosing this problem your fix worked exactly as
expected and I have just pushed it up to the Org-mode repository.
Best -- Eric
>
> Nick
>
>
>
--
Eric Schulte
http://cs.unm.edu/~eschulte/
next prev parent reply other threads:[~2011-10-18 16:09 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
2011-10-18 16:09 ` Eric Schulte [this message]
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=87r52a2se1.fsf@gmail.com \
--to=schulte.eric@gmail.com \
--cc=emacs-orgmode@gnu.org \
--cc=nicholas.dokos@hp.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).