From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp1 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id +GZxKr7rAmA4cwAA0tVLHw (envelope-from ) for ; Sat, 16 Jan 2021 13:35:58 +0000 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp1 with LMTPS id ANAdJr7rAmCCFQAAbx9fmQ (envelope-from ) for ; Sat, 16 Jan 2021 13:35:58 +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 146599404D0 for ; Sat, 16 Jan 2021 13:35:58 +0000 (UTC) Received: from localhost ([::1]:54432 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l0lkB-0008S9-Lt for larch@yhetil.org; Sat, 16 Jan 2021 08:35:55 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:56762) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l0ljc-0008S3-Im for emacs-orgmode@gnu.org; Sat, 16 Jan 2021 08:35:20 -0500 Received: from mail-wm1-x329.google.com ([2a00:1450:4864:20::329]:51316) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1l0lja-0002yt-NL for emacs-orgmode@gnu.org; Sat, 16 Jan 2021 08:35:20 -0500 Received: by mail-wm1-x329.google.com with SMTP id h17so9508547wmq.1 for ; Sat, 16 Jan 2021 05:35:17 -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=sDDj+mq9kogQ5hHGVk1PRAFeCy22qUFgZcOS7FUO75g=; b=OrgqFZGg8ZKGMwoTcmfPkQUGqMmw6Gfu73mjckloOYcN+CUbLE43vYC5qtKryuPRpP MSn3M0qlLwGhLbMKCV1I/e8c5WvrBrF9UDdyTdFfe02sguD4A1HW2hqBdXE2x+hTUGmY 9ADFVh7ikimiNJ4MC6dsNw93T9kYoAPQGhULgmrGYwnyq1SmsdwsYwU94hDKAczKnmyj jKZcQHiPwRArpdbA9HikWMI/GoC04BGqQAt5MTvebMeX2RKn8U8ztX71G+4/2ofRMC4S vifOyAHx0FbkldWsRlHV+G550oq3YBqIAzXdLYJV4BqktTbD1Nhr2Z+xrYPEgLwkalZk NSqw== 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=sDDj+mq9kogQ5hHGVk1PRAFeCy22qUFgZcOS7FUO75g=; b=bV7Quo/c7oBkor/Jjt5Iktd896CpxBvMBWdJ+VGqkMETKQN5VZeOvrNR28WaD2Uire h4cGhhSg62i9YPM7OR+j53+iSqhwNcxooKaYcNAQdMgyLQJhQCQk0JNcxCU3NhOEjRuS tGUNReO4W+COzKc4eDwtuzcR5L9BAbzpDUvf5Sb3ITd8DsOXA6x2YR9ziV2wsKMW+i3p ZmjeIsbN2OFG/3AXOPLeH3YHdrNyxnf3+QjLvl13kAfV8HStEW8TF2MVT/zdYvdGya+I bN1vMCCXdCDCPeJUlzJWNzlaN6aG7CilR2p7paMHLklBd/Pfbi9hI8Em783Sn9KQ72Lk rBdQ== X-Gm-Message-State: AOAM532aARSIJvWHfnJZhSYpCPh+b9wKTncT16aTg/buCzJ4HTm9NXT4 qW9PTA5ZVrzqFmDjL18dbdZeZQNXgLk= X-Google-Smtp-Source: ABdhPJy13yfLNrHvcGL1bUAa/XVieQ/P/5rTXNPgg8BvHJP7jd+bAFKBu0d+LsGggHdG+svfCwgNBw== X-Received: by 2002:a1c:f70c:: with SMTP id v12mr13055178wmh.77.1610804116615; Sat, 16 Jan 2021 05:35:16 -0800 (PST) Received: from freegnu (82-64-129-7.subs.proxad.net. [82.64.129.7]) by smtp.gmail.com with ESMTPSA id t1sm19461024wro.27.2021.01.16.05.35.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 16 Jan 2021 05:35:16 -0800 (PST) From: Jeremie Juste To: "Berry, Charles" via "General discussions about Org-mode." Subject: Re: na=\"nil\" in ob-R.elo References: <87h7njdr0x.fsf@ufl.edu> <97F6B6F8-E109-4089-8C21-03E087AA4AD3@health.ucsd.edu> Date: Sat, 16 Jan 2021 14:35:14 +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: <87im7xuhrh.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain Received-SPF: pass client-ip=2a00:1450:4864:20::329; envelope-from=jeremiejuste@gmail.com; helo=mail-wm1-x329.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: -1.56 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20161025 header.b=OrgqFZGg; 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: 146599404D0 X-Spam-Score: -1.56 X-Migadu-Scanner: scn0.migadu.com X-TUID: pNxudYfyp8OX Hello, Thanks for the feedback || On Saturday, 16 Jan 2021 at 00:19, Berry, Charles" via "General discussions about Org-mode. wrote: > 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'. As a quick work around you can use #+name: remove-nil #+begin_src emacs-lisp :var tbl="" (mapcar (lambda (row) (mapcar (lambda (cell) (if (equal "nil" cell) "" cell)) row)) tbl) #+end_src #+BEGIN_SRC R :results value :colnames yes :post remove-nil[:colnames yes](*this*) data.frame(A=c(NA,1,1,1,1),B=c(1,2,NA,4,4)) #+end_src #+RESULTS: | A | B | |---+---| | | 1 | | 1 | 2 | | 1 | | | 1 | 4 | | 1 | 4 | >> 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. Thanks Chuck for pointing this out. R users are used to handle NA but in this particular case where empty string and NA are treated the same, I'm not sure the nil feature is very useful. If it does not break anything else I will consider removing it. Best regards, -- Jeremie Juste