From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0 ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id YCpNN4ZXDWFFbwAAgWs5BA (envelope-from ) for ; Fri, 06 Aug 2021 17:38:46 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0 with LMTPS id ABQYM4ZXDWFoJgAA1q6Kng (envelope-from ) for ; Fri, 06 Aug 2021 15:38:46 +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 0F02B1E6E1 for ; Fri, 6 Aug 2021 17:38:46 +0200 (CEST) Received: from localhost ([::1]:60576 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mC1vo-0003gF-R2 for larch@yhetil.org; Fri, 06 Aug 2021 11:38:44 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:51080) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mC1vT-0003fy-Ed for emacs-orgmode@gnu.org; Fri, 06 Aug 2021 11:38:23 -0400 Received: from mail-vs1-xe33.google.com ([2607:f8b0:4864:20::e33]:33286) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mC1vR-0003LA-Q9 for emacs-orgmode@gnu.org; Fri, 06 Aug 2021 11:38:23 -0400 Received: by mail-vs1-xe33.google.com with SMTP id h17so733337vsu.0 for ; Fri, 06 Aug 2021 08:38:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to :content-transfer-encoding; bh=n3T7qP0L4fsBd3LnVV9ASK6Cf/0LRgtu7+Q5+fGiPdo=; b=umQdAzvFsHi+CAAOY+Hlp0wC70bKhHXQE1hVYdYDSy44/UGgM33obkydWvTfsK4xJc MnH72aI+IMAlquMVT+TBaV94RyIl6Lj20hd+dUixed7bGNTRxahB8JZXShpQE0PBpwlt qlwXYhFL+JE9QDEzSozk8ybWxPkwgxmHYuAAmvPtJ46uZhklQHF1jbQjuqOj8iIDkZta H1S8WRQSqVRm8rwbWrpYTm2+iRaOuKZxaExYaZOS532QQJG6QSciLYqptB77nVGMoiBH 2r6vlYvTwlxaQlE8TgJADMk/wCMN12/gVH+gBybQlGx3eJFQsYb49CimRkfGT1zskWxS EqHA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to :content-transfer-encoding; bh=n3T7qP0L4fsBd3LnVV9ASK6Cf/0LRgtu7+Q5+fGiPdo=; b=JC/3VcAtouuOIsfUnjy7DBGfYKVlxeOUTUJomFp/iBTm3CL32WYqYNwqV5wUeDQ8Mg 0ttx2+ilrjewfa2M2x693X77nj+zVj/hZYKt3bRHQaSwOGhqh328IOGYoCJewnMBM6CQ bidra31FPtUfUWOMpvy4xVWswvk/brpzrwJv5zNEL22AmzsgTlx7flFxQ8ozApolOHXw LFH+EdiP2tkp+9XtDfv2JEYd0ohoT3E9qgVjA/DlMO7c2WO5qVhGNGA7KYxoVzjjeA+N 5E0fg9SHr1+h5jg7ozOZuV8wme6dluIIZokFVsRfsUa2H+ip4Ve3CB6SvRiD+yGERpqe lUDw== X-Gm-Message-State: AOAM532kt0bIHYHDUVUB8clBfrfzU1G4LACYBBTcU68qL6xV7msve1PY KM/p16FTlzwgkNx3+f56qCUgdsIbKhNNlPFQQz8cEB/p7NUV8A== X-Google-Smtp-Source: ABdhPJwd+BfDHOejiXNv+eMdDDTpdhy4izdK9Lkf3a43ujNIPGb1KC8QBpyq0yck3P7AvClvoLUMD3GuyxIFPzh+xoo= X-Received: by 2002:a05:6102:2d1:: with SMTP id h17mr1591041vsh.2.1628264300262; Fri, 06 Aug 2021 08:38:20 -0700 (PDT) MIME-Version: 1.0 From: John Hendy Date: Fri, 6 Aug 2021 10:38:09 -0500 Message-ID: Subject: Number format for table results outut from R data.frame/tibble To: emacs-orgmode Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass client-ip=2607:f8b0:4864:20::e33; envelope-from=jw.hendy@gmail.com; helo=mail-vs1-xe33.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: , Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org Sender: "Emacs-orgmode" X-Migadu-Flow: FLOW_IN ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1628264326; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding:list-id:list-help: list-unsubscribe:list-subscribe:list-post:dkim-signature; bh=n3T7qP0L4fsBd3LnVV9ASK6Cf/0LRgtu7+Q5+fGiPdo=; b=Y3aHibILqzm2PYIWe/kq1EQHKmkvNKkCZPcaiVY7AcoD8C3XanPjvbG9xnWLbpGtJZH/Y5 uUZWy/oNQYv80Yq0rrQGbJT5O4M1os3KgmqmIv0xpAiMZJ7NoB43mt11Q2D8yAiS9wSsfW Igi6bFAoEa3Y5OYp+QkXwCyitmqZLAG23LG5U6MQW8Ds85WHByptu5WXBmEWl8FYNxzEZZ /wKKNX3dhO0cEnj40QDbDl3e5hTYcsBQ+WsWteCo+vYgyJGfbEizq2786NNEi/S7tKwG2x PyrKZsg8ILJ4iawtOoU+dLkKf/wHkiGYpHatQrlqWINLIOwnW+81ZTHTasZkSA== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1628264326; a=rsa-sha256; cv=none; b=ib9sOCtGRHAAfB5GYPpri4Vlf2OGjayj23beY93a7qQsND11hfDQ/XX4kg7AY3/vRryzya RNuPfhtRb02xFgunRBLQkZTCDFUn2DMByZkWik01G3hm4LpHjVrJ1t+9wge1tWcwTtJ/3c dLGOLt12uVx71cpHS8GOK1jLmF4AddXiAW40ZJ2o2BVyJPjQfsOVn+gS1l9wbwisQGq/K4 qMquwQ9D/Nl/8qPfq5gRgH4T5YgQOTGZLlCFAwHGnjB25lUmoRtGh14VKemmUOHWsofeF2 51pC29W/WUxPnN8CtsZYRXpgXXTQqyQHNp0iCEFrKdNmxn6U73Fd06NtTJO0SQ== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20161025 header.b=umQdAzvF; 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-Spam-Score: -3.12 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20161025 header.b=umQdAzvF; 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: 0F02B1E6E1 X-Spam-Score: -3.12 X-Migadu-Scanner: scn1.migadu.com X-TUID: VVkfqLTeSO9g Greetings, I'm wondering how to align the results from the R buffer (which I like) vs. the results printed by Org-mode for table results. Here's a toy example: #+begin_src R :session foo :output results :type table :results value library(tibble) tmp <- tibble(x=3D1:5, y=3Dx/pi) tmp #+end_src In org, I get this: #+RESULTS: | 1 | 0.318309886183791 | | 2 | 0.636619772367581 | | 3 | 0.954929658551372 | | 4 | 1.27323954473516 | | 5 | 1.59154943091895 | In the buffer, I get this: x y 1 1 0.318 2 2 0.637 3 3 0.955 4 4 1.27 5 5 1.59 >From the tibble side, R points one to the pillar package[1], which indeed affects the output in the buffer, but not in the Org results. #+begin_src R :session foo :output results :type table :results value library(tibble) library(pillar) options(pillar.sigfig=3D1) tmp <- tibble(x=3D1:5, y=3Dx/pi) tmp #+end_src # A tibble: 5 =C3=97 2 x y 1 1 0.3 2 2 0.6 3 3 1. 4 4 1. 5 5 2. The last example here touches on accomplish this[2]... but is the only method to write an elisp block that post-process my R results? It seems so enticing that R can output the correct format... can Org latch onto the exact output somehow? I also discovered the round_df package[3], so I could bring that into the mix and round flexibly, it seems. I don't *really* want to round, though, I just want more digestible output. Many thanks for any pointers, I'm suspecting the answer is before my eyes, but I haven't figured out the proper incantation of :results, :type, :wrap, etc... Best regards, John [1] https://pillar.r-lib.org/articles/digits.html [2] https://orgmode.org/manual/Results-of-Evaluation.html [3] https://rdrr.io/cran/forestmangr/man/round_df.html