emacs-orgmode
[Top][All Lists]
Advanced

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

[FR] Allow passing nested list structures to variables in src blocks (wa


From: Ihor Radchenko
Subject: [FR] Allow passing nested list structures to variables in src blocks (was: [BUG] ob-R.el: extra empty data.frame columns generated from plain lists after recent change [9.6 (release_9.6-3-ga4d38e @ /usr/share/emacs/30.0.50/lisp/org/)])
Date: Sun, 11 Dec 2022 08:51:02 +0000

Johan Tolö <johan@toloe.se> writes:

> I do pass org plain lists to R source code blocks which is why I 
> found the current issue. It is easy enough for me to adapt my R 
> code whenever there is a change in the way it is handled. It is 
> unfortunate that it will no longer be possible to access any 
> nested elements of plain lists but it does not affect me because I 
> was not using that feature.

If necessary, we may adapt the recent idea with list-name[] and allow
passing ranges to the lists, similar to tables.

What I have in mind:

1. variable=list-name will assign top-level items as a list (item1 item2 ...)
2. variable=list-name[] will allow nesting: ((item1) (item2 (sub-list)) ...)
3. variable=list-name[from:to,...]

It will be a new feature, of course.

> I think that the output from R source code blocks should be as 
> close to the example in the org manual as possible. I also think 
> that the handling within ob-R.el should be as simple as possible. 
> I do not mind if that means that I have to convert a data.frame 
> from columns to rows.
>
> For anyone wondering, you can simply unlist() a data.frame to get 
> a vector of the columns.

I am also in favour of staying as close as possible to the manual. I find
converting lists to tables non-intuitive.

-- 
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]