From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id EO/8CML2HmD4MQAA0tVLHw (envelope-from ) for ; Sat, 06 Feb 2021 20:06:26 +0000 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2 with LMTPS id ICy+BML2HmDaJgAAB5/wlQ (envelope-from ) for ; Sat, 06 Feb 2021 20:06:26 +0000 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 72129940275 for ; Sat, 6 Feb 2021 20:06:25 +0000 (UTC) Received: from localhost ([::1]:46280 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l8TqZ-0000kn-HI for larch@yhetil.org; Sat, 06 Feb 2021 15:06:23 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:36710) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l8TpV-0000kb-2e for emacs-orgmode@gnu.org; Sat, 06 Feb 2021 15:05:17 -0500 Received: from mail-wr1-x42d.google.com ([2a00:1450:4864:20::42d]:33042) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1l8TpT-000379-Az for emacs-orgmode@gnu.org; Sat, 06 Feb 2021 15:05:16 -0500 Received: by mail-wr1-x42d.google.com with SMTP id 7so12158557wrz.0 for ; Sat, 06 Feb 2021 12:05:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=WeD7MWcAPNdt7t/NPIrNOteYqxWe1Qth/Cza+LC+soM=; b=YgkHipoqLVkkERwNg3EJ7oc1ctTZdHPNhX3kTPlGFrF3OAD2t39KYpsGwA1xnv3EKY pinO4rgOvfWQ6VtGy6glWa5I+4NF1IsWG7kD0jnM4YqxKbGObM7q/o0WrpMjhV9+N6m6 /tMpTvsPRvQLpJPiMfBJD91ujzn/K1SFRnOoq/BNQCmvx9jufCRGeIIS8ScVj3STf0dC NtRsxn78Lmg+dFTtWh2ZHA2mCLTAQ/U1lGYFH0Eng3iKk5yftjX0jDguv2z+4VArM+2D nwe0Ojt7YY8STe7OANxfy8j1Dnr7VBPd0bqTp6/vZC1v88cVToet/VD6c/wtBrhG3tVF qPeQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version; bh=WeD7MWcAPNdt7t/NPIrNOteYqxWe1Qth/Cza+LC+soM=; b=qCfpCTvYbGRCTYc+wXaoeTLcO9cLdFYjc99gRq+aWk3B42KC7jKKbSoD6oQclYLuuK Q/pjcFrcdxQ26pphjXkXXZKjNWWCh9ObOAmSLra0RbKhgXejJ1/aNyMRrsJ7Z9Zuy343 WKIaIf/mdqiZ84MRct9EfN84K+44alR4r2GPJByRU6Tqx9EykVMONVBuzphhvbRwxn9a 3OsucxYKOgOcLoNw6TRpzWZG2sfq+oRiKg5Dg/QkgxGBOfUs5+o2dthr1X8dcxm/vrhJ goEINx5bUAfvq2RbZZec8ufj2f3UH+EdAnG5ik8G+MOJS9GQp7Jjq1YZGiMOrQsjo6iq iK/g== X-Gm-Message-State: AOAM5320OzxPaKXL1pwLpraE4vKSQnKaT/aiTdIZKl4Va+LxXBMLQsqA 31dwFtrpxGub87UYDSecdRE= X-Google-Smtp-Source: ABdhPJyekxDSatBbkpvhAuRdUvYzEIGIElp6seuKZN+rLnQl/hbnt+X+kexwvPMFUJ7rnUsNKLspDw== X-Received: by 2002:a5d:6351:: with SMTP id b17mr11623913wrw.410.1612641913444; Sat, 06 Feb 2021 12:05:13 -0800 (PST) Received: from freegnu (82-64-129-7.subs.proxad.net. [82.64.129.7]) by smtp.gmail.com with ESMTPSA id x125sm12868730wmx.6.2021.02.06.12.05.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 06 Feb 2021 12:05:12 -0800 (PST) From: Jeremie Juste To: emacs-orgmode@gnu.org Subject: Re: na=\"nil\" in ob-R.elo References: <87h7njdr0x.fsf@ufl.edu> <97F6B6F8-E109-4089-8C21-03E087AA4AD3@health.ucsd.edu> Date: Sat, 06 Feb 2021 21:05:09 +0100 In-Reply-To: <97F6B6F8-E109-4089-8C21-03E087AA4AD3@health.ucsd.edu> (Charles Berry's message of "Sat, 16 Jan 2021 00:19:05 +0000") Message-ID: <87pn1dufm2.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Received-SPF: pass client-ip=2a00:1450:4864:20::42d; envelope-from=jeremiejuste@gmail.com; helo=mail-wr1-x42d.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.23 Precedence: list List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Brett Presnell , "Berry, Charles" Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org Sender: "Emacs-orgmode" X-Migadu-Flow: FLOW_IN X-Migadu-Spam-Score: -3.06 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20161025 header.b=YgkHipoq; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (aspmx1.migadu.com: domain of emacs-orgmode-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=emacs-orgmode-bounces@gnu.org X-Migadu-Queue-Id: 72129940275 X-Spam-Score: -3.06 X-Migadu-Scanner: scn1.migadu.com X-TUID: XAYAmD3pd0kL --=-=-= Content-Type: text/plain Hello, Thanks again for reporting this. With the attached patch I'll remove nil replacement for NA. --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=0001-For-results-value-return-empty-string-instead-of-nil.patch >From 90881079d431a8af3cba5be14ecf882735ed7a6a Mon Sep 17 00:00:00 2001 From: Jeremie Juste Date: Sat, 6 Feb 2021 20:50:00 +0100 Subject: [PATCH] For :results value, return empty string instead of nil --- lisp/ob-R.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lisp/ob-R.el b/lisp/ob-R.el index f6fa9a417..981f21119 100644 --- a/lisp/ob-R.el +++ b/lisp/ob-R.el @@ -349,7 +349,7 @@ Each member of this list is a list with three members: { tfile<-tempfile() write.table(object, file=tfile, sep=\"\\t\", - na=\"nil\",row.names=%s,col.names=%s, + na=\"\",row.names=%s,col.names=%s, quote=FALSE) file.rename(tfile,transfer.file) }, -- 2.20.1 --=-=-= Content-Type: text/plain Best regards, Jeremie On Saturday, 16 Jan 2021 at 00:19, Berry, Charles" via "General discussions about Org-mode. wrote: >> On Jan 14, 2021, at 3:42 PM, Brett Presnell wrote: >> >> >> Probably a silly question, but in ob-R.el, what is the reason for >> setting na=\"nil\" when defining org-babel-R-write-object-command? Is >> this an elisp compatibility thing? >> > > I don't get it either. The value corresponding to the NA becomes a string in emacs-lisp whether \"nil\" or \"\" is used. > > So when passed to elisp via a :post header referencing an emacs-lisp src block, its treated as a string. > >> Regardless, I generally (always?) want na=\"\" for this, so I am finding >> all those "nil"s very annoying, and the only way that I see to defeat >> them is to redefine org-babel-R-write-object-command. >> >> If there is no reason for the current behavior (doubtful I know) and if >> I am not missing an obvious work-around, then I would like to suggest >> changing this behavior. Otherwise, would it be feasible to add an >> option for R code blocks (:nastring?) where one could specify the NA >> replacement string? >> >> What do you think? It's easy to suggest I know and certainly beyond my >> elisp coding skills at present, but I am supposing that someone more >> fluent in elisp could do this safely without too much trouble. >> > > You can use a :post header to customize outputs like this to make them more pleasing. Or just use your own `org-babel-R-write-object-command'. > > Adding another header arg qualifies as feature creep and in this case would require non-trivial work to implement. > > HTH, > > Chuck > -- Jeremie Juste --=-=-=--