emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [BUG] With R using ":var d=data" breaks ":colnames yes" [9.7-pre (re


From: Ihor Radchenko
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

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>



reply via email to

[Prev in Thread] Current Thread [Next in Thread]