From mboxrd@z Thu Jan 1 00:00:00 1970 From: John Hendy Subject: Refresher on including R/ggplot2 output via latex/pdf? Date: Sun, 27 Oct 2019 23:16:00 -0500 Message-ID: Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Return-path: Received: from eggs.gnu.org ([2001:470:142:3::10]:59566) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iOwRy-0008Uk-UA for emacs-orgmode@gnu.org; Mon, 28 Oct 2019 00:16:16 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iOwRx-0008Kv-N4 for emacs-orgmode@gnu.org; Mon, 28 Oct 2019 00:16:14 -0400 Received: from mail-qt1-x831.google.com ([2607:f8b0:4864:20::831]:35010) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iOwRx-0008Kg-HS for emacs-orgmode@gnu.org; Mon, 28 Oct 2019 00:16:13 -0400 Received: by mail-qt1-x831.google.com with SMTP id l3so2243645qtp.2 for ; Sun, 27 Oct 2019 21:16:12 -0700 (PDT) List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: "Emacs-orgmode" To: emacs-orgmode Greetings, I used to use orgmode + R/ggplot2 for some time, but for various reasons I've been using python almost exclusively for a couple years. I just went to use what I think is how I used to include ggplot2 results in PDF experts, but it's not working. In referring to the documentation, this is listed as an example: - https://orgmode.org/worg/org-contrib/babel/languages/ob-doc-R.html#org046a0ff * does produce a file, by using :results output #+begin_src R :file 3.png :results output graphics library(lattice) xyplot(1:10 ~ 1:10) #+end_src My test file: ----- * test #+begin_src R :results output graphics :exports results :file foo.png library(ggplot2) df <- data.frame(x=c(1, 2), y=c(2, 4)) p <- ggplot(df, aes(x = x, y = y)) + geom_point() print(p) #+end_src ----- I'm using emacs -Q, followed by M-x load-file RET path/to/min-config: ----- ;; set load paths ;; set load dirs and global config options (add-to-list 'load-path "~/.elisp/org/lisp/") (add-to-list 'load-path "~/.elisp/org/contrib/lisp/") (add-to-list 'load-path "~/.elisp/ess/lisp/") (require 'ess-site) ; setup babel languages (org-babel-do-load-languages 'org-babel-load-languages '((R . t))) ----- M-x org-version: Org mode version 9.2.4 (release_9.2.4-381-g226363 @ /home/jwhendy/.elisp/org/lisp/) When I run the code, the #+RESULTS: output is just blank. foo.png *is* generated, but the file link ([[foo.png]]) I'd expect is not getting inserted. It also, unsurprisingly, does not show in the file. Hmmm. One last hail Mary google incantation before I sent this off suggests that perhaps it's :results file now? Or :results graphics file? - https://stackoverflow.com/questions/50054520/python-vs-r-in-org-mode-babel-output-graphics Thanks for any pointers. I'd be happy to assist with updated documentation if the earlier link is now outdated/incorrect. Best regards, John