A Special Graphics Device in R: the Null Device | /en/2010/12/a-special-graphics-device-in-r-the-null-device/
A Special Graphics Device in R: the Null Device
https://yihui.org/en/2010/12/a-special-graphics-device-in-r-the-null-device/
https://yihui.org/en/2010/12/a-special-graphics-device-in-r-the-null-device/
Guest *michal* @ 2010-12-24 14:51:40 originally posted:
Hi, thanks for digging this out. Very useful.
I think Sweave might evaluate each figure chunk twice, because it produces both PDF and EPS by default...
We can turn them off by \SweaveOpts{pdf=FALSE, eps=FALSE}. Who cares about postscript figures these days? I only used EPS figures when I began to learn LaTeX a couple of years ago.
Originally posted on 2010-12-25 03:37:58
Guest *michal* @ 2010-12-25 03:47:28 originally posted:
Indeed. The only occasion I use EPS is when I have to use the path .tex > .dvi > .ps > .pdf when, for example, I use pstricks to create some fancy diagrams. Otherwise I use pdflatex all the time.
Guest *Huang* @ 2010-12-24 20:32:33 originally posted:
It is worthwhile but the difference in my MAC is not that dramatic.
user system elapsed
0.612 0.005 0.613
user system elapsed
2.909 0.233 3.918
Guest *MartinInChemnitz* @ 2011-01-17 02:41:16 originally posted:
Is there no way to change the default device to tikz - even for interactive sessions?
For
Graph=ggplot()
we have the Graph as a work piece R object that requires
print(Graph)
for display, anyhow.
All differences between the processing of code chunks for inclusion into the literate programming document
and the interactive code are such a waste of our precious user (life)time!
There are so many other things in my life on which I would love to waste more time.
For the first question: yes, it is just what the option 'device' does; you may set options(device = tikzDevice::tikz). This might not be useful -- you know very little about what you are really producing, since the graphics are recorded in an off-screen manner.
Second question: I don't think there is a huge difference in terms of the output. In an interactive session, you can adjust your code and results little by little, and in Sweave, you have no chance of such adjustments -- you have to submit all the code as a batch job. Usually I ``waste'' time in an interactive session to decide what I really need, then put the mature code in Sweave (which might be subject to minor changes in future, though).
Originally posted on 2011-01-17 02:53:06
Guest *dmschruth* @ 2011-05-04 04:24:20 originally posted:
Nice! However, this doesn't appear to work when used from inside a function. It works.
You mean the code like below does not work?
f = function() {
.Call("R_GD_nullDevice", PACKAGE = "grDevices")
plot(rnorm(100))
dev.off()
}
f()
Originally posted on 2011-05-04 19:05:08
Guest *timb* @ 2011-06-07 17:56:16 originally posted:
Thank you! The problem of unwanted Rplots.pdf seems to be common. I thought there ought to be a null device, but I doubt I would have found it without your help.
Guest *human mathematics* @ 2011-09-12 07:33:39 originally posted:
Awesome. You just saved my computer hours of redundant twitching. Thank you.
Guest *Karl Forner* @ 2012-12-28 10:20:27 originally posted:
Thanks a lot !!!
Sign in to join the discussion
Sign in with GitHub