From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp12.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id GIEDInG+j2MUgAAAbAwnHQ (envelope-from ) for ; Tue, 06 Dec 2022 23:13:05 +0100 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp12.migadu.com with LMTPS id YGrwIXG+j2Ng0AAAauVa8A (envelope-from ) for ; Tue, 06 Dec 2022 23:13:05 +0100 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 3A8FB40BF8 for ; Tue, 6 Dec 2022 23:13:05 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1p2gAY-0007tQ-Tr; Tue, 06 Dec 2022 17:12:06 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1p2gAY-0007tH-2C for emacs-orgmode@gnu.org; Tue, 06 Dec 2022 17:12:06 -0500 Received: from mail-ej1-x62b.google.com ([2a00:1450:4864:20::62b]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1p2gAS-0002vK-HP for emacs-orgmode@gnu.org; Tue, 06 Dec 2022 17:12:05 -0500 Received: by mail-ej1-x62b.google.com with SMTP id n20so9860456ejh.0 for ; Tue, 06 Dec 2022 14:11:59 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:user-agent:message-id:in-reply-to:date:references :subject:cc:to:from:from:to:cc:subject:date:message-id:reply-to; bh=ZmyU0ePfAJA9TI6cBTAaYzp4j0UWk/WikLFnpfYk8PA=; b=Ef5anxfWxjksEaln4kU/6j9hEtiL7bE5nIMmNKzK6IT0u161PaWZ83nGYNX2MR71up cNdvP7iqWt5eVjRjFT6X5QyC1AhS3UZA6GDauxHfYhSlF/g4EAFRGwL167k1LPHZsZTM d6XavRRO0pfbC0iFrIEf+3ttntiS96SIT3BDlb+T9hBTFvUzBjdJ7Hf7sLLYMWJ9APiE 278wCCwpQS768q7PORSndMBirp4dK083pJh1Ecua44m0nb9O43l+PdWTEtCtmuDSKrnw 5FgSGbsQG6XdDoCn69DY3s9bP9W6DIzfeL+2bj4aS/3JiRoIRTLNnFcwA1CwrU17DSDC kPlw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=mime-version:user-agent:message-id:in-reply-to:date:references :subject:cc:to:from:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=ZmyU0ePfAJA9TI6cBTAaYzp4j0UWk/WikLFnpfYk8PA=; b=25jMsBn2dIWkfRXlmSwp/yK03JYmVNcXrpiba2TSs+jJstCJhuAjS0NDKBWBcyAIv9 EPmBnaYYVh1krdlUU61OmuvyFfxBR9zHXdbSvcL4wLdoHOM+UbJ6Nf7REaU110R3YyUZ IyIucdCK4tJjpiaLV6XPjIGBZFX4DRNxS9kNSf/TYc4BeSuF0JjqGqJUPvW74PWRAgr4 Mqfgt9o21SIWRLEFfHnVwcbMBh1O9zm2yNxVoHlEW7WhRDZEB7h9oHk18RO/p6m4aWrk VSzqWpZGWn8T0AKAXHq4WQ5FexzT0xgt1OLhM2E1aeBeVQ3iYUX1/J0rhvH2unvB0frQ U8RQ== X-Gm-Message-State: ANoB5pnH8pNVr9LmZcG9yBS0MmT5O4pwclSlcPeCtwNhQXyuOHM8csxR 3P7xmGklcGSHrSb/okCREfw= X-Google-Smtp-Source: AA0mqf53rLf5U/Dslxg2wlnQoDg8MzB9IyPugntLh8ux4cA1XRx0tt9PFZsZobKG7hgy8YvmPe2WNw== X-Received: by 2002:a17:906:6c93:b0:7c0:ff76:7866 with SMTP id s19-20020a1709066c9300b007c0ff767866mr6849663ejr.272.1670364718175; Tue, 06 Dec 2022 14:11:58 -0800 (PST) Received: from flexignu ([2a02:908:1d5:3c20:aad5:3ec8:79e0:90e9]) by smtp.gmail.com with ESMTPSA id d21-20020a170906305500b007838e332d78sm7794757ejd.128.2022.12.06.14.11.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 06 Dec 2022 14:11:57 -0800 (PST) From: Jeremie Juste To: Greg Minshall Cc: Johan =?utf-8?Q?Tol=C3=B6?= , emacs-orgmode@gnu.org, "Berry, Charles" Subject: Re: [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/)] References: <87wn77mdvk.fsf@toloe.se> <766358.1670208594@archlinux> Date: Tue, 06 Dec 2022 23:11:56 +0100 In-Reply-To: <766358.1670208594@archlinux> (Greg Minshall's message of "Sun, 04 Dec 2022 18:49:54 -0800") Message-ID: <87wn74xjv7.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain Received-SPF: pass client-ip=2a00:1450:4864:20::62b; envelope-from=jeremiejuste@gmail.com; helo=mail-ej1-x62b.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-orgmode@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org Sender: emacs-orgmode-bounces+larch=yhetil.org@gnu.org X-Migadu-Flow: FLOW_IN X-Migadu-Country: US ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1670364785; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=ZmyU0ePfAJA9TI6cBTAaYzp4j0UWk/WikLFnpfYk8PA=; b=gvUoWxEpk7+5UZbZc/YYy/4B0hq0QdO755BdgkHu4qaECfWlWSHP1lhccx+nj+d2BqF1od 1udY25DIfXBt8HLXTWWpaD4SnmK45DdnwKlZ8jaOzD+XgBzWXMJnA0Bpp5c6B9q+9XCPt3 Jgepn1x+WRWsBvAjhoMw2dcwg9wfkVKRfxDTM517yp2lOzURPeS+dixvOZXa59VPVeP758 5ariDZAEAtBl5ht9AZ83QsFW3mdwKVXiTAXNad5VLK0nr1xJuJegfuY9LUZmZcIfVRGzKe yQh6nFms14jZUmWgMG47/o4D1Objq3kmWGr//83NcaT6APEUIhNLaQZLXkStUw== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1670364785; a=rsa-sha256; cv=none; b=rgcCvnbrj+uqdocSUFpk+2f+M4X7Pv0Woc1iJXR4u8uy7QFewu/spEV80xwE0G6AMj8BC8 UFPBM2QJLjOgLdzG67BRTUaGe2rXVIaKVlYm/hQb9u/ZPjHKk7fjPlZk5m7kjDst+9aJYZ mjQzOAK2J+4OMTs2+pHmTl5IypRDe3W5ROzmSZby2hyi1rmNt86gmaJ3DOi4V03wyyXig8 Dy6RCgWMrth8gHuqMBfE84jZaaS5HuPKN5teHTRWzxcMHnFoRfwt4FKk8Yt7VKGThEXd94 pScuAaF6GBo7mJddwmEwwXtTSPhf5JuZOcNfouy0QQgWRbBI0iesCwDL6wLxyg== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=Ef5anxfW; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (aspmx1.migadu.com: domain of "emacs-orgmode-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="emacs-orgmode-bounces+larch=yhetil.org@gnu.org" X-Migadu-Spam-Score: -6.27 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=Ef5anxfW; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (aspmx1.migadu.com: domain of "emacs-orgmode-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="emacs-orgmode-bounces+larch=yhetil.org@gnu.org" X-Migadu-Queue-Id: 3A8FB40BF8 X-Spam-Score: -6.27 X-Migadu-Scanner: scn0.migadu.com X-TUID: vn77RnXd/Ys2 Hello, Many thanks for the insights. I confess that I have never transferred list from org to R before. I've always use tables and as far as I understand they works fine in 9.6. So assuming this list #+name: alist - first item - second item - third item - 3.1 item - fourth item before c72d5ee84 we could do something like #+begin_src R :var list=alist list #+end_src #+RESULTS: | first item | | | second item | | | third item | (unordered (3.1 item)) | | fourth item | | and after we end up with #+begin_src R :var list=alist list #+end_src #+RESULTS: | first item | second item | third item | fourth item | | | | | | | Here I'm on uncharted territory. We could go with 1. | first item | second item | third item | fourth item | or be closer to the version 9.5 with 2. | first item | | second item | | third item | | fourth item | However I'm still tempted to choose the second option to break as little workflow as possible. If we go in this direction the solution of Chuck works fine. Many thanks for the suggestions. > @@ -241,7 +241,7 @@ This function is called by `org-babel-execute-src-block'." > (defun org-babel-R-assign-elisp (name value colnames-p rownames-p) > "Construct R code assigning the elisp VALUE to a variable named NAME." > (if (listp value) > - (let* ((lengths (mapcar 'length (cl-remove-if-not 'sequencep value))) > + (let* ((lengths (mapcar 'length (cl-remove-if-not 'listp value))) > (max (if lengths (apply 'max lengths) 0)) > (min (if lengths (apply 'min lengths) 0))) > ;; Ensure VALUE has an orgtbl structure (depth of at least 2). - (unless (listp (car value)) (setq value (list value))) + (unless (listp (car value)) (setq value (mapcar 'list value))) Do you have any case of using org-list to R? Do you think we could use the list for a different purpose. Suggestions are welcome. Best regards, Jeremie On Sunday, 4 Dec 2022 at 18:49, Greg Minshall wrote: > for the record, these are the tests i ran with my off-the-cuff "fix" > (s/sequencep/listp/): > ---- > > #+name: alist > - first item > > - second item > - third item > > #+begin_src R :var list=alist :session ss > list > #+end_src > > > #+RESULTS: > | first item | second item | third item | > > #+begin_src R :var variable='(a test) > variable > #+end_src > > > #+RESULTS: > | a | test | > > #+name: atable > | this | is | a | header | line | > > |------+----+---+--------+------| > | 1 | 2 | 3 | 4 | 5 | > | a | b | c | d | e | > > #+begin_src R :var list=atable :session ss > list > #+end_src > > > #+RESULTS: > | 1 | 2 | 3 | 4 | 5 | > | a | b | c | d | e | > > #+begin_src R :var list='((1 2 3) (1 2)) > list > #+end_src > > > #+RESULTS: > | 1 | 2 | 3 | > | 1 | 2 | | > > #+begin_src elisp :var list=alist > list > #+end_src > > #+RESULTS: > | first item | second item | third item |