Error opening pdf files generated using PDF graphic device
4
0
Entering edit mode
Hari Easwaran ▴ 240
@hari-easwaran-3510
Last seen 9.5 years ago
United States
Hi all, I am trying to use the pdf graphic device to make some plots and save as pdf files. I get the following error when I try to open the pdf file. "There was an error opening this document. The file is damaged and could not be repaired." The command I am using is: pdf(file="x.pdf") boxplot(X[,2:11]) X is a data.frame containing values I want to plot. Following is my R.version: $platform [1] "i386-apple-darwin9.8.0" $arch [1] "i386" $os [1] "darwin9.8.0" $system [1] "i386, darwin9.8.0" $status [1] "" $major [1] "2" $minor [1] "11.1" $year [1] "2010" $month [1] "05" $day [1] "31" $`svn rev` [1] "52157" $language [1] "R" $version.string [1] "R version 2.11.1 (2010-05-31)" Any help is gratefully appreciated. Thanks. Hari [[alternative HTML version deleted]]
• 11k views
ADD COMMENT
0
Entering edit mode
@kasper-daniel-hansen-2979
Last seen 17 months ago
United States
You need to close the device, like dev.off() Kasper On Tue, Aug 17, 2010 at 1:00 PM, Hari Easwaran <hariharan.pe at="" gmail.com=""> wrote: > Hi all, > I am trying to use the pdf graphic device to make some plots and save as pdf > files. I get the following error when I try to open the pdf file. > "There was an error opening this document. The file is damaged and could not > be repaired." > > The command I am using is: > > pdf(file="x.pdf") > > boxplot(X[,2:11]) > > X is a data.frame containing values I want to plot. > > Following is my R.version: > $platform > [1] "i386-apple-darwin9.8.0" > $arch > [1] "i386" > $os > [1] "darwin9.8.0" > $system > [1] "i386, darwin9.8.0" > $status > [1] "" > $major > [1] "2" > $minor > [1] "11.1" > $year > [1] "2010" > $month > [1] "05" > $day > [1] "31" > $`svn rev` > [1] "52157" > $language > [1] "R" > $version.string > [1] "R version 2.11.1 (2010-05-31)" > > Any help is gratefully appreciated. > > Thanks. > > Hari > > ? ? ? ?[[alternative HTML version deleted]] > > _______________________________________________ > 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 COMMENT
0
Entering edit mode
@vincent-j-carey-jr-4
Last seen 12 weeks ago
United States
this is a question for R-help. i suspect the problem is that you did not say dev.off() after running the plot command to let the driver finish the PDF output. On Tue, Aug 17, 2010 at 1:00 PM, Hari Easwaran <hariharan.pe@gmail.com>wrote: > Hi all, > I am trying to use the pdf graphic device to make some plots and save as > pdf > files. I get the following error when I try to open the pdf file. > "There was an error opening this document. The file is damaged and could > not > be repaired." > > The command I am using is: > > pdf(file="x.pdf") > > boxplot(X[,2:11]) > > X is a data.frame containing values I want to plot. > > Following is my R.version: > $platform > [1] "i386-apple-darwin9.8.0" > $arch > [1] "i386" > $os > [1] "darwin9.8.0" > $system > [1] "i386, darwin9.8.0" > $status > [1] "" > $major > [1] "2" > $minor > [1] "11.1" > $year > [1] "2010" > $month > [1] "05" > $day > [1] "31" > $`svn rev` > [1] "52157" > $language > [1] "R" > $version.string > [1] "R version 2.11.1 (2010-05-31)" > > Any help is gratefully appreciated. > > Thanks. > > Hari > > [[alternative HTML version deleted]] > > _______________________________________________ > Bioconductor mailing list > Bioconductor@stat.math.ethz.ch > https://stat.ethz.ch/mailman/listinfo/bioconductor > Search the archives: > http://news.gmane.org/gmane.science.biology.informatics.conductor > [[alternative HTML version deleted]]
ADD COMMENT
0
Entering edit mode
@james-w-macdonald-5106
Last seen 6 hours ago
United States
Hi Hari, On 8/17/2010 1:00 PM, Hari Easwaran wrote: > Hi all, > I am trying to use the pdf graphic device to make some plots and save as pdf > files. I get the following error when I try to open the pdf file. > "There was an error opening this document. The file is damaged and could not > be repaired." > > The command I am using is: > > pdf(file="x.pdf") > > boxplot(X[,2:11]) This is a question for R-help, as this has nothing to do with BioC packages. But to answer your question, you are missing a call to dev.off(). Best, Jim > > X is a data.frame containing values I want to plot. > > Following is my R.version: > $platform > [1] "i386-apple-darwin9.8.0" > $arch > [1] "i386" > $os > [1] "darwin9.8.0" > $system > [1] "i386, darwin9.8.0" > $status > [1] "" > $major > [1] "2" > $minor > [1] "11.1" > $year > [1] "2010" > $month > [1] "05" > $day > [1] "31" > $`svn rev` > [1] "52157" > $language > [1] "R" > $version.string > [1] "R version 2.11.1 (2010-05-31)" > > Any help is gratefully appreciated. > > Thanks. > > Hari > > [[alternative HTML version deleted]] > > _______________________________________________ > 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 Douglas Lab University of Michigan Department of Human Genetics 5912 Buhl 1241 E. Catherine St. Ann Arbor MI 48109-5618 734-615-7826 ********************************************************** Electronic Mail is not secure, may not be read every day, and should not be used for urgent or sensitive issues
ADD COMMENT
0
Entering edit mode
Heidi Dvinge ★ 2.0k
@heidi-dvinge-2195
Last seen 10.3 years ago
Hi Hari, did you remember to include dev.off() after your plot to close the pdf device again? \Heidi On 17 Aug 2010, at 18:00, Hari Easwaran wrote: > Hi all, > I am trying to use the pdf graphic device to make some plots and > save as pdf > files. I get the following error when I try to open the pdf file. > "There was an error opening this document. The file is damaged and > could not > be repaired." > > The command I am using is: > > pdf(file="x.pdf") > > boxplot(X[,2:11]) > > X is a data.frame containing values I want to plot. > > Following is my R.version: > $platform > [1] "i386-apple-darwin9.8.0" > $arch > [1] "i386" > $os > [1] "darwin9.8.0" > $system > [1] "i386, darwin9.8.0" > $status > [1] "" > $major > [1] "2" > $minor > [1] "11.1" > $year > [1] "2010" > $month > [1] "05" > $day > [1] "31" > $`svn rev` > [1] "52157" > $language > [1] "R" > $version.string > [1] "R version 2.11.1 (2010-05-31)" > > Any help is gratefully appreciated. > > Thanks. > > Hari > > [[alternative HTML version deleted]] > > _______________________________________________ > 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 COMMENT

Login before adding your answer.

Traffic: 630 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