Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Message from discussion Plots and Command Output?
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Derek Ogle  
View profile  
 More options Jul 4 2012, 6:16 pm
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?

Carl,

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]
Sent: Wednesday, July 04, 2012 1:22 PM
To: Derek Ogle
Cc: knitr@googlegroups.com
Subject: Re: [knitr] Plots and Command Output?

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
Professor of Mathematical Sciences & Natural Resources
Northland College
1411 Ellis Ave
Ashland, WI  54806

e-mail: do...@northland.edu<mailto:do...@northland.edu>
web: www.ncfaculty.net/dogle/<http://www.ncfaculty.net/dogle/>

--
Carl Boettiger
UC Davis
http://www.carlboettiger.info/


 
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.