From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp10.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id dDWTNfRajWMMUQAAbAwnHQ (envelope-from ) for ; Mon, 05 Dec 2022 03:44:05 +0100 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp10.migadu.com with LMTPS id AEDhM/RajWPnGAAAG6o9tA (envelope-from ) for ; Mon, 05 Dec 2022 03:44:04 +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 2C1E725BF6 for ; Mon, 5 Dec 2022 03:44:03 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1p21Rz-0000Oi-R6; Sun, 04 Dec 2022 21:43:23 -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 1p21Rx-0000OW-DQ for emacs-orgmode@gnu.org; Sun, 04 Dec 2022 21:43:21 -0500 Received: from relay-egress-host.us-east-2.a.mail.umich.edu ([18.216.144.57] helo=legit-cyhyraeth.relay-egress.a.mail.umich.edu) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1p21Rv-0002aq-BA for emacs-orgmode@gnu.org; Sun, 04 Dec 2022 21:43:20 -0500 Received: from neat-barghest.authn-relay.a.mail.umich.edu (ip-10-0-73-252.us-east-2.compute.internal [10.0.73.252]) by legit-cyhyraeth.relay-egress.a.mail.umich.edu with ESMTPS id 638D5AC1.1B2EFAF7.7E61089E.929856; Sun, 04 Dec 2022 21:43:13 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=umich.edu; s=relay-2018-08-29; t=1670208193; bh=d6ahUmBe7GhL4QJgNTkplv69WoCdupB2T9CAJe5wY0k=; h=To:cc:From:Subject:In-reply-to:References:Date; b=rwxyYWMGGWebYWhWKjmFroDCPjMc4vd+XYlCNEao1Gv2NXXjtND66zaJHlNGXKhyw 3frDBXFUu0R9M3OyWgyjDcIGkzXFHWYvWjkVy1JTsqcFXMwS+0L6/XVzDDN5blfgKq o5WQhRMhojTd3khOcaqP56YE0OFAT3bWgdirL0q1In8dgHzM3IwFenbf5nY8SRPvL2 oHA2aGZ4vLoHtC4xsXyXx981j7FZCEy2WIABlHj6Fg4rkNHjuMNb3KduWcxjN+Gagp DoUUCQe65LXaShfkQOPEy43XMQi3f54i6SWZ/Psq7uDYrK3CV3EfW57thvKGvmK58A iEA26/VTaeg0A== Received: from localhost (097-086-128-062.res.spectrum.com [97.86.128.62]) by neat-barghest.authn-relay.a.mail.umich.edu with ESMTPSA id 638D5AC0.1248EFD1.4770F371.2553102; Sun, 04 Dec 2022 21:43:12 -0500 To: Johan =?utf-8?Q?Tol=C3=B6?= cc: emacs-orgmode@gnu.org From: Greg Minshall 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/)] In-reply-to: <87wn77mdvk.fsf@toloe.se> References: <87wn77mdvk.fsf@toloe.se> Comments: In-reply-to Johan =?utf-8?Q?Tol=C3=B6?= message dated "Sun, 04 Dec 2022 15:34:07 +0100." X-Mailer: MH-E 8.6+git; nmh 1.7.1; GNU Emacs 28.1.91 MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <765037.1670208188.1@archlinux> Date: Sun, 04 Dec 2022 18:43:08 -0800 Message-ID: <765038.1670208188@archlinux> Received-SPF: pass client-ip=18.216.144.57; envelope-from=minshall@umich.edu; helo=legit-cyhyraeth.relay-egress.a.mail.umich.edu 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, 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=1670208244; 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=d6ahUmBe7GhL4QJgNTkplv69WoCdupB2T9CAJe5wY0k=; b=BvJ6HZ99meAP5uXZasNFMxXZbUUoMF8j6MSM7QyQUwuHQV4qj5v0RGMvTmJ+6D8TnqAkXZ wi6AJFEH3wlQapMK2He6vnWn4MnsozOHcRM7Qf7D1LMBqtEwkT8fXqPpmVHn8segHhs853 Mvh0xPHTkZidI2KWgEYOGef5PFtfgRaw321UhWqHWJpSvfzv/KU+yp6bP6IuKiu1qiexrP AZlirUTbBhzde0C08ElMDzDzRgWwbFUE/jRforz8pq5MTLIuKLZCLyrHv39IEn0H4PAB4z QgkEeqk7XkkuJQwSDyfM40jymotD1iGfTJIcHPrSLc2K6tXpEVPbGb63SyzBVg== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1670208244; a=rsa-sha256; cv=none; b=Tj1mEYprQ/5wR2KkLNa0jY5hE0YgARWopcz+Bynd1SBygT6+fpSvmL8oJjDQNUU/U5ague IQij1Q3Tgnrn1nhbzS5pBzMwVfda6AFbqioohP6uUojohbYezGo289+a/OM++9hnnySgSs t38t+VHdJewdCO46NaemKXaslpVQwBkWHIhffhfxP5rTP9wRM/7AlysLqqMoHIgMYO75Cz +6p0H+z5rnb+77WcFXuQbG/+sYnsJzEHCz4txVb2FhOG1mmcJPFdOuCrOCISm8jZxtxj6N 3BIlcCuqZz9NxR6P4PKWeCCk6FJHghrTBunNeq5ERKh/EssewemEnB9OBBAwfA== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=umich.edu header.s=relay-2018-08-29 header.b=rwxyYWMG; dmarc=pass (policy=none) header.from=umich.edu; 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: -4.46 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=umich.edu header.s=relay-2018-08-29 header.b=rwxyYWMG; dmarc=pass (policy=none) header.from=umich.edu; 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: 2C1E725BF6 X-Spam-Score: -4.46 X-Migadu-Scanner: scn1.migadu.com X-TUID: sPM8EUXHtv1W i see this same behavior. to me, (org-babel-R-assign-elisp) seems to be the problem, but it hasn't changed any time recently. (nor, if my =git blame= is done correctly, has anything else in ob-R.el.) i don't understand how (org-babel-R-assign-elisp) thinks. it seems to assign =max= and =min= assuming that =value= is a list of (at least one) list(s). this *might* be a fix. but, i don't have a lot of confidence it will not have bad side effects for other cases. (though i tested it with a simple list, and a simple table with more than one row, and a list of two lists, the first of length 3, the second of length 2.): ---- modified lisp/ob-R.el @@ -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). ----