dev.copy and rRcript
1
0
Entering edit mode
Amanda Miotto ▴ 120
@amanda-miotto-2933
Last seen 10.2 years ago
I have a Bioconductor based script running that uses dev.copy and dev.off to save images to my hard drive which works well. However, when I try to run it with Rscript (from the terminal) instead of R, it doesn't save the images as it should, and a file called Rplots.pdf has been created. How do I get around this? gdPlot(yeplotlist,labelCex=1) filename<-paste(currentgene,"graph.jpeg",sep="") dev.copy(jpeg, filename, width = 1000, units = "px") dev.off() Thanks, Amanda Miotto a.miotto at griffith.edu.au Software Engineer Research Computing Services INFORMATION SERVICES Griffith University, NATHAN 4111, AUSTRALIA Phone: +61 7 37354419 Fax: +61 7 37356650 Web: http://eResearch.griffith.edu.au/ PRIVILEGED - PRIVATE AND CONFIDENTIAL: This email and any files transmitted with it are intended solely for the use of the addressee(s) and may contain information which is confidential or privileged. If you receive this email and you are not the addressee(s) [or responsible for delivery of the email to the addressee(s)], please disregard the contents of the email, delete the email and notify the author immediately.
• 1.7k views
ADD COMMENT
0
Entering edit mode
@james-w-macdonald-5106
Last seen 17 minutes ago
United States
Hi Amanda, Amanda Miotto wrote: > I have a Bioconductor based script running that uses dev.copy and dev.off to > save images to my hard drive which works well. However, when I try to run it > with Rscript (from the terminal) instead of R, it doesn't save the images as > it should, and a file called Rplots.pdf has been created. How do I get > around this? > gdPlot(yeplotlist,labelCex=1) > filename<-paste(currentgene,"graph.jpeg",sep="") > dev.copy(jpeg, filename, width = 1000, units = "px") > dev.off() Using dev.copy() seems needlessly complex. If you want a jpeg, why don't you use the jpeg() function? jpeg("graph.jpeg", width=1000) plot(1:10) dev.off() Works identically for me interactively and via Rscript. Best, Jim > Thanks, > Amanda Miotto > a.miotto at griffith.edu.au > Software Engineer > Research Computing Services > INFORMATION SERVICES > Griffith University, NATHAN 4111, AUSTRALIA > Phone: +61 7 37354419 Fax: +61 7 37356650 > Web: http://eResearch.griffith.edu.au/ > PRIVILEGED - PRIVATE AND CONFIDENTIAL: > This email and any files transmitted with it are intended solely for > the use of the addressee(s) and may contain information which is > confidential or privileged. If you receive this email and you are > not the addressee(s) [or responsible for delivery of the email to the > addressee(s)], please disregard the contents of the email, delete the > email and notify the author immediately. > _______________________________________________ > Bioconductor mailing list > Bioconductor at stat.math.ethz.ch > https://stat.ethz.ch/mailman/listinfo/bioconductor > Search the archives: http://news.gmane.org/gmane.science.biology.informatics.conductor -- James W. MacDonald, M.S. Biostatistician Hildebrandt Lab 8220D MSRB III 1150 W. Medical Center Drive Ann Arbor MI 48109-0646 734-936-8662
ADD COMMENT
0
Entering edit mode
As described by the dev.copy() manual page, dev.copy(), dev.print(), and dev.copy2eps() all require that the device have the recording of graphics operations enabled to function properly. Most interactive (screen) devices have recording turned on by default, while most non-interactive (file) devices have recording turned off by default. Recording can be turned on using the command dev.control(displaylist = "enable") and off using dev.control(displaylist = "inhibit") which should only be done when a device is initially created. -Greg [Original author of dev.copy()] -----Original Message----- From: bioconductor-bounces@stat.math.ethz.ch [mailto:bioconductor-bounces at stat.math.ethz.ch] On Behalf Of James W. MacDonald Sent: Friday, October 31, 2008 8:40 AM To: Amanda Miotto Cc: r-help-request at stat.math.ethz.ch; bioconductor at stat.math.ethz.ch Subject: Re: [BioC] dev.copy and rRcript Hi Amanda, Amanda Miotto wrote: > I have a Bioconductor based script running that uses dev.copy and dev.off to > save images to my hard drive which works well. However, when I try to run it > with Rscript (from the terminal) instead of R, it doesn't save the images as > it should, and a file called Rplots.pdf has been created. How do I get > around this? > gdPlot(yeplotlist,labelCex=1) > filename<-paste(currentgene,"graph.jpeg",sep="") > dev.copy(jpeg, filename, width = 1000, units = "px") > dev.off() Using dev.copy() seems needlessly complex. If you want a jpeg, why don't you use the jpeg() function? jpeg("graph.jpeg", width=1000) plot(1:10) dev.off() Works identically for me interactively and via Rscript. Best, Jim > Thanks, > Amanda Miotto > a.miotto at griffith.edu.au > Software Engineer > Research Computing Services > INFORMATION SERVICES > Griffith University, NATHAN 4111, AUSTRALIA > Phone: +61 7 37354419 Fax: +61 7 37356650 > Web: http://eResearch.griffith.edu.au/ > PRIVILEGED - PRIVATE AND CONFIDENTIAL: > This email and any files transmitted with it are intended solely for > the use of the addressee(s) and may contain information which is > confidential or privileged. If you receive this email and you are > not the addressee(s) [or responsible for delivery of the email to the > addressee(s)], please disregard the contents of the email, delete the > email and notify the author immediately. > _______________________________________________ > Bioconductor mailing list > Bioconductor at stat.math.ethz.ch > https://stat.ethz.ch/mailman/listinfo/bioconductor > Search the archives: http://news.gmane.org/gmane.science.biology.informatics.conductor -- James W. MacDonald, M.S. Biostatistician Hildebrandt Lab 8220D MSRB III 1150 W. Medical Center Drive Ann Arbor MI 48109-0646 734-936-8662 _______________________________________________ Bioconductor mailing list Bioconductor at stat.math.ethz.ch https://stat.ethz.ch/mailman/listinfo/bioconductor Search the archives: http://news.gmane.org/gmane.science.biology.informatics.conductor
ADD REPLY

Login before adding your answer.

Traffic: 838 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6