From: Ihor Radchenko <yantar92@posteo.net>
To: Paul Stansell <paulstansell@gmail.com>
Cc: emacs-orgmode@gnu.org
Subject: Re: [BUG] With R using ":var d=data" breaks ":colnames yes" [9.7-pre (release_9.6.10-881-g595a32]
Date: Thu, 07 Mar 2024 13:20:28 +0000 [thread overview]
Message-ID: <87wmqexjoj.fsf@localhost> (raw)
In-Reply-To: <CAMJKaZwtXfTksqW7AY2HMb99FSv56PKzhRAr=-8n0MfRKwxHqg@mail.gmail.com>
Paul Stansell <paulstansell@gmail.com> writes:
> It seems that using ":var d=data" breaks ":colnames yes" in the header of
> an R code block.
> ...
> #+name: data
> |--------+--------|
> | x | y |
> |--------+--------|
> | 111.89 | 88.37 |
> | 392.12 | 297.33 |
> |--------+--------|
It is expected.
:colnames yes implies:
The ‘colnames’ header argument accepts ‘yes’, ‘no’, or ‘nil’
values. The default value is ‘nil’: if an input table has column
names--because the second row is a horizontal rule--then Org
removes the column names, processes the table, puts back the column
names, and then writes the table to the results block. Using
‘yes’, Org does the same to the first row, even if the initial
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
table does not contain any horizontal rule. When set to ‘no’, Org
does not pre-process column names at all.
In your table, the first row is a horizontal line, so Org tries to parse
the first line as column names. And fails, of course.
I guess that we can make `org-babel-get-colnames' smarter and make it
skip the leading hlines.
--
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at <https://orgmode.org/>.
Support Org development at <https://liberapay.com/org-mode>,
or support my work at <https://liberapay.com/yantar92>
next prev parent reply other threads:[~2024-03-07 13:17 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-03-06 23:09 [BUG] With R using ":var d=data" breaks ":colnames yes" [9.7-pre (release_9.6.10-881-g595a32] Paul Stansell
2024-03-07 13:20 ` Ihor Radchenko [this message]
2024-03-07 18:38 ` Paul Stansell
2024-03-07 19:05 ` Ihor Radchenko
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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87wmqexjoj.fsf@localhost \
--to=yantar92@posteo.net \
--cc=emacs-orgmode@gnu.org \
--cc=paulstansell@gmail.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 external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.