From: John Hendy <jw.hendy@gmail.com>
To: emacs-orgmode <emacs-orgmode@gnu.org>
Subject: Refresher on including R/ggplot2 output via latex/pdf?
Date: Sun, 27 Oct 2019 23:16:00 -0500 [thread overview]
Message-ID: <CA+M2ft9CGxiCFYLmysVzPeYWLK_pci9znZtown3_GbavGc5Wkw@mail.gmail.com> (raw)
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
next reply other threads:[~2019-10-28 4:16 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-10-28 4:16 John Hendy [this message]
2019-10-28 4:32 ` Refresher on including R/ggplot2 output via latex/pdf? Jack Kamm
2019-10-28 4:40 ` John Hendy
2019-10-28 5:03 ` Jack Kamm
2019-10-28 5:13 ` John Hendy
2019-10-28 6:15 ` Jack Kamm
2019-10-28 7:43 ` John Hendy
2019-10-28 16:21 ` Berry, Charles
2019-10-28 16:30 ` John Hendy
2019-10-28 17:46 ` Jack Kamm
2019-10-29 14:39 ` John Hendy
2019-10-29 14:50 ` Jack Kamm
2019-10-29 15:13 ` John Hendy
2019-11-30 19:21 ` Jack Kamm
2019-10-28 8:21 ` Dominique Dumont
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.orgmode.org/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=CA+M2ft9CGxiCFYLmysVzPeYWLK_pci9znZtown3_GbavGc5Wkw@mail.gmail.com \
--to=jw.hendy@gmail.com \
--cc=emacs-orgmode@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).