From: Derek Ogle <DO...@northland.edu>
Date: Wed, 4 Jul 2012 17:16:20 -0500
Local: Wed, Jul 4 2012 6:16 pm
Subject: RE: [knitr] Plots and Command Output?
That does the trick!! Thanks for the very prompt help (I never would have come up with that).
From: Carl Boettiger [mailto:cboet...@gmail.com]
If you'd like the figures not to appear in the resulting pdf at all, I think you'll want to redefine plot at the beginning of your script:
knit_hooks$set(plot = function(x, options) "")
e.g. I add this command before calling knit() when I want to compile a pdf where images are not embedded (e.g. for journals that require this). Could probably be set chunk by chunk if necessary, but I'm guessing you want this to be the global behavior.
hth,
Carl
On Wed, Jul 4, 2012 at 11:17 AM, Derek Ogle <DO...@northland.edu<mailto:DO...@northland.edu>> wrote:
knitr's,
I would like to have a chunk that echos all R commands, shows the results that would be printed to the console below the R commands, but "saves" the graphs to be used in an \includegraphics call and does not print the graphs immediately after the R command that constructs the graph. I can't seem to find the right combination of include=, results=, echo=, etc. that will result in what I want. I guess my question is ... is it possible to suppress the immediate showing of graphics while still allowing the immediate showing of R console output within the same chunk?
In the attached example, I would like the results from chunk 3 with the exception that the histogram immediately following hist() (the unlabeled histogram) would not appear.
Any thoughts on how to accomplish this task would be greatly appreciated. Thank you in advance.
Dr. Derek H. Ogle
e-mail: do...@northland.edu<mailto:do...@northland.edu>
--
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
| ||||||||||||||