4

If I want to plot a diagram to pdf it doesn't work. I only get an empty pdf page. Here is a small example.

> pdf("try.pdf")
> plot(x=c(1,2,4,2,5))
> dev.off()

I also tried the print() command. But with no luck:

> print(plot(x=c(1,2,4,2,5)))
NULL            # <- is this an error?

My OS is Ubuntu 12.10 64bit. My R version is 2.15.2.

Other output formats are working (e.g. jpeg(), png()). It's the first time I'm using the pdf output in Ubuntu (I worked on Win before without problems).

Any help will be welcome.

Joko
  • 2,539
  • 3
  • 17
  • 24
  • 1
    What version of R, operating system, etc. are you working under? Has this worked in the past and failed recently, or is this the first time you've ever tried? Do other output formats work? You're not giving us very much information to help you with here... – Jonathan Christensen Jan 24 '13 at 23:45
  • 2
    I'm guessing this is more complicated. That code should succeed unless your pdf device is broken. Read the R-FAQ. Section 7, about why it might not succeed with lattice or ggplot2 plotting commands. – IRTFM Jan 24 '13 at 23:48
  • 3
    results of `capabilities()` ? – Ben Bolker Jan 25 '13 at 00:36
  • Something solved my problem. But I don't know the solution any more. – Joko Feb 05 '16 at 10:21

2 Answers2

0

A reboot of my computer solved the problem. But I can't say why it didn't worked yesterday.

Joko
  • 2,539
  • 3
  • 17
  • 24
0

Old question but I had the same problem just now and I was pretty puzzled.

In my case it turned out that the /tmp directory was full. After removing unwanted tmp files things got back to normal. Additional problem I was having: invoking the help for any function (e.g. "help(mean)") returned just empty pages.

dariober
  • 8,240
  • 3
  • 30
  • 47