From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp12.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id yFgnMEMI3mGyrwAAgWs5BA (envelope-from ) for ; Tue, 11 Jan 2022 23:44:19 +0100 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp12.migadu.com with LMTPS id WHrxLEMI3mGohAAAauVa8A (envelope-from ) for ; Tue, 11 Jan 2022 23:44:19 +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 5ED572FA11 for ; Tue, 11 Jan 2022 23:44:19 +0100 (CET) Received: from localhost ([::1]:58830 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1n7PsI-0007q9-8Z for larch@yhetil.org; Tue, 11 Jan 2022 17:44:18 -0500 Received: from eggs.gnu.org ([209.51.188.92]:50306) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n7Pqo-0007oK-Of for emacs-orgmode@gnu.org; Tue, 11 Jan 2022 17:42:46 -0500 Received: from [2607:f8b0:4864:20::92f] (port=45573 helo=mail-ua1-x92f.google.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1n7Pqn-0007Wh-2u for emacs-orgmode@gnu.org; Tue, 11 Jan 2022 17:42:46 -0500 Received: by mail-ua1-x92f.google.com with SMTP id x33so1347350uad.12 for ; Tue, 11 Jan 2022 14:42:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:from:date:message-id:subject:to; bh=vLjuLKnkpxCI7oI+bI5Xjw4vKphB/8HiRaJNS0wjoNM=; b=kadtjiLb/tqmDPTSQmowuudXHxAlQ58Fi4De+z5VvLL0cwhXX91UqQnv3/4YIRHbUp LLvsJY34mqDxSgPu4TmxB8ngYlEgEOLKQmQogb8MvrIkFG6rnfYQDeXqbhTBAbJjreKe WRiUX0Z1zM9MarEnGZ5HFAXI0g0HZyseN9c4RdAaUF/ZJcjJ/UUPtrDEivNYvp9lOzrI 6B42o7gul+5ZUT1DSPP7BeAjwgqj7R/Ta51YAg5ariXmcYFYX0U3CrWG5/gAmO83mZXi 2laQx9YE2z0uPDtwjgnW9WOWcKJle/1cpzdzie65m5OC2HGPvmK0NDsCPBSueydlgvUV JgVw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=vLjuLKnkpxCI7oI+bI5Xjw4vKphB/8HiRaJNS0wjoNM=; b=K1Bzui/arLrKJu/uXwZMRAV5ghnnTPDnp02Z4CDO91Zl7iS4yQOg0sdwHL9UGEW70W 81V6GAx/SjAk3+hXCKYBWkdIdwzDF+rT96nM+DPZIzbb4V8IgaxhrYe8skrjYGJV7igh MExGatWNBbfWbD4Y3oSbUKx/FpaPw+ymsrGM93Uh/8xq2iMnbuTXFdkTivwy6rq+Gnz6 y5w8FyylZ151CNp0q771pVL1GP/++Kq59pglHB9l7f0szJwkEgT0sMuh9FcVjrWRXRoc d6yE9crqa84M+VAJzwXPscEVzYZxloITTvUMqcn7FP9HHROEzvhEV1N4ITdWKN+RZG66 D/Dw== X-Gm-Message-State: AOAM530y2L6FbReCenk6dEbNkremWG55h6NGAdzV255+k4EaQOyiZTLy dwq/379lYzELVjvALO3yPr6NchVnmytx3h/nrxnO+NhsCoR/qA== X-Google-Smtp-Source: ABdhPJwcXcFr2B61Z/19m5j+CCm2JlIyoiZEvtyRYcc5GgLMboemeRtSuDQBlY1lGgE4Cst2KLnkc2/8/2ef6tc4a2A= X-Received: by 2002:a67:fb59:: with SMTP id e25mr2964826vsr.78.1641940963860; Tue, 11 Jan 2022 14:42:43 -0800 (PST) MIME-Version: 1.0 From: John Hendy Date: Tue, 11 Jan 2022 16:42:33 -0600 Message-ID: Subject: R terminal output does not match src block output due to ">" character in results To: emacs-orgmode Content-Type: text/plain; charset="UTF-8" X-Host-Lookup-Failed: Reverse DNS lookup failed for 2607:f8b0:4864:20::92f (failed) Received-SPF: pass client-ip=2607:f8b0:4864:20::92f; envelope-from=jw.hendy@gmail.com; helo=mail-ua1-x92f.google.com X-Spam_score_int: -12 X-Spam_score: -1.3 X-Spam_bar: - X-Spam_report: (-1.3 / 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, RDNS_NONE=0.793, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no 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" 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=1641941059; 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:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=vLjuLKnkpxCI7oI+bI5Xjw4vKphB/8HiRaJNS0wjoNM=; b=abrMu9dyDRNmmlEk+DSVb5ZA7qifIzLgxQxBJfDOhMe8GFp0xI7t5kuwEn5ZWwFPmJOfGD yckqFRueDF79FJAfvQS1DOvin7VizOJvJveUoHN8oIRmBCvkEABFVdekChjYHiKin9577p jaHOxgDz9fpQNMxM1v+3q1Nh9veJ6Dh4U/BgKbpfJ1JFWLGQb5UR6AFheRbyt0pjGsgSOM IgqC1Y/b1pmh2QYnwi0icJcL6Wj194LAf2QIDeQ5Iz4p7WaAHRZp3diODh54f/SMQX47eM EmxLbwT1dgxmDpHmKhe94Ws6UqEkVH8wXQkdGZvIohPQSAtA1SH6UrMAwsooaQ== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1641941059; a=rsa-sha256; cv=none; b=W9uSZDN6mQtTfbDvTxIci/AsoH4tNTL64Ai3I8IV/8CL7o9wQc5dojvi7MbzdfGgz7NDr4 ItoRR1z8BFxYnOhJiIFdciNIlKG/AbK9dZZAKlX2nKPKQlOv8cdGPYelcRs+udqDYVynEm poWAcbNxPxCqk+r25zq5aZno3o7oWUI2D2N8cT/kIWno+1yBzzGVsiT0s5+aylpN9JZsWl suFj+skFLQEoHJM2KR+dcKegDLDF5MzyJQqNqvRVewc15Ec82h0Y2Z05EHtkq20VnvjVwi NB7OSjrnLPIAOiOvmdX+5oJ50rQ2u0PpH1FbQrkC11lbBc9vqO2xmEIz935k2A== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=kadtjiLb; 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.12 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=kadtjiLb; 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: 5ED572FA11 X-Spam-Score: -6.12 X-Migadu-Scanner: scn0.migadu.com X-TUID: LTP+2KXwsVWM I just ran into an issue where results look fine in the terminal, but not in the results of a source block. I can't share the real example as it's work confidential, but a couple of rows across 7 columns looks like this in the terminal: #+begin_example terminal dbGetQuery(con, paste0("SELECT TOP 2 * FROM table")) 1 NA NA FALSE 0 5 2 NA NA FALSE 0 5 #+end_example When I use this with :exports results :results output drawer in my document, I get: #+begin_example src 1 < NA NA < FALSE 0 5 2 < NA NA < FALSE 0 5 #+end_example I had an entirely separate email written and about to send, when it dawned on me that the > character is the same as the R terminal prompt and might be the cause. My first attempt to reproduce was unsuccessful: #+begin_src R :session :exports results :results output drawer df <- data.frame( x = letters[1:3], y = c(1, 2, NA), z = c("x", NA,"z")) df #+end_src #+RESULTS: :results: x y z 1 a 1 x 2 b 2 3 c NA z :end: I'm not sure if it's about more columns or more rows, but this does the trick: #+begin_src R :session :exports results :results output drawer df <- data.frame( x = letters[1:7], y = c(1, 2, NA, NA, NA, NA, NA), z = c("x", NA, NA, NA, NA, NA, "z"), a = c(1, rep(NA, 6))) df #+end_src #+RESULTS: :results: x y z a 1 a 1 x 1 2 b 2 < NA 3 c NA < NA ### ... shortened :end: If you comment out the line with z=, it works again... but that's the column with all the values. Then again, if you end the data.frame at z and don't add column a, it *also* works despite the presence of many values. #+RESULTS: :results: x y z 1 a 1 x 2 b 2 3 c NA ### ... shortened :end: I'm imagining there's a... "parser?" somewhere that typically strips off the command prompt from the results perhaps (and recall some vague memory of someone telling me this years ago on the list). Is there a way to stop this from happening? Would this line be responsible, or something else? https://github.com/bzg/org-mode/blob/main/lisp/ob-R.el#L453 Many thanks, John