Error : Unable to start png() device

I cannot explain why, but I once found that when the folder path in which my RStudio project was saved was a very long character string, the png device would fail. When I shortened the folder path it worked.


I had the same issue while working in an r-markdown document.

The issue in my case had something to do with viewing the Chunk Output Inline. When I switched to viewing the Chunk Output in Console, it worked just fine.


Had the same problem on a PC. The problem was that there was an antivirus program with "Safe files" enabled, which blocked Rstudio from creating graphics files. The antivirus didn't display any information when blocking, so it doesn't give you any clues really.


I got also this error: "Error in (function (filename = "Rplot%03d.png", width = 480, height = 480, : unable to start png() device"

The name of the .Rmd file that I've been working on was containing some nonenglish characters, so removing them has been helpful in my case.