emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Ihor Radchenko <yantar92@posteo.net>
To: "Johan Tolö" <johan@toloe.se>
Cc: Greg Minshall <minshall@umich.edu>,
	Jeremie Juste <jeremiejuste@gmail.com>,
	emacs-orgmode@gnu.org, "Berry, Charles" <ccberry@health.ucsd.edu>
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	[thread overview]
Message-ID: <87359mmih5.fsf@localhost> (raw)
In-Reply-To: <877cyz4djj.fsf@toloe.se>

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	other threads:[~2022-12-11  8:52 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-12-04 14:34 [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/)] Johan Tolö
2022-12-05  2:43 ` Greg Minshall
2022-12-05 10:29   ` Johan Tolö
2022-12-05 11:21     ` Jérémie Juste
2022-12-05 18:57   ` Berry, Charles
2022-12-06  0:41     ` Greg Minshall
2022-12-06  4:31       ` Berry, Charles
2022-12-06  6:52         ` Greg Minshall
2022-12-05  2:49 ` Greg Minshall
2022-12-06 22:11   ` Jeremie Juste
2022-12-07  1:31     ` Greg Minshall
2022-12-07  1:53       ` William Denton
2022-12-07 12:16     ` Ihor Radchenko
2022-12-07 21:08       ` Jeremie Juste
2022-12-08  9:07         ` Ihor Radchenko
2022-12-08 12:42           ` Greg Minshall
2022-12-08 12:51             ` Ihor Radchenko
2022-12-08 13:33               ` Greg Minshall
2022-12-10 12:31               ` Johan Tolö
2022-12-11  8:51                 ` Ihor Radchenko [this message]
2022-12-11 15:31           ` Jeremie Juste
2022-12-12  9:47             ` Ihor Radchenko
2022-12-12 12:17               ` Greg Minshall
2022-12-12 12:27                 ` Ihor Radchenko
2022-12-13 13:29                 ` Johan Tolö
2022-12-14  2:53                   ` Greg Minshall
2022-12-15  8:51                     ` Johan Tolö
2022-12-15 17:50                       ` Greg Minshall
2022-12-29 16:00               ` Bastien Guerry
2022-12-29 23:52                 ` Berry, Charles
2022-12-30  9:25                   ` Bastien
2022-12-31 12:42                   ` Ihor Radchenko
2022-12-30  9:24               ` Bastien Guerry

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=87359mmih5.fsf@localhost \
    --to=yantar92@posteo.net \
    --cc=ccberry@health.ucsd.edu \
    --cc=emacs-orgmode@gnu.org \
    --cc=jeremiejuste@gmail.com \
    --cc=johan@toloe.se \
    --cc=minshall@umich.edu \
    /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).