5

When plotting a dendrogram in R, I get a funny error that I've never seen before.

Error in plot.new() : 
  cannot open file 'C:\Users\Sun\AppData\Local\Temp\RtmpKSRNuD\pdf12207aa37548', reason No such file or directory

I didn't have that error yesterday when plotting other dendrograms and saving it in PDF files .. Any idea what it means?

madkitty
  • 1,657
  • 6
  • 24
  • 37

1 Answers1

6

Related answer at Plot() error when using REngine.Rserve suggests sending a dev.close() call as a workaround for "not closing the device correctly last time" (specifically under Rserve).

Related answer at Cannot open file '', reason No such file or directory suggests using file.path as a alternative to paste for creating filenames with platform-independent path separators.

I'm having better luck with graphics.off(). The difference is that dev.close() closes the current device, graphics.off() closes all open devices. In my case, I'm writing a PDF inside a knitr Rmd called from an Rserve session, so I may have multiple open devices.

I'm also finding that there's a mysterious folder named (null).1001.1001 (it's on an Ubuntu box, logged in as uid 1001, gid 1001). The presence of this folder seems to help in my case.

Community
  • 1
  • 1
woodvi
  • 1,898
  • 21
  • 27
  • Thanks for accepting this answer. Which observation was the most helpful? – woodvi Jun 27 '16 at 22:21
  • This should be broken up into multiple answers as per http://meta.stackoverflow.com/questions/314022/how-to-deal-with-multiple-answers-in-the-same-answer – woodvi Jun 27 '16 at 22:28