2
votes

I am getting an error message while running knit to HTML. But If I run chunk individually, it draws plot as expected. What would be a problem? The error message is below:

Quitting from lines 270-274 (HC_FC_indivisual_cellline_fdr_1%.Rmd) Error in png(..., res = dpi, units = "in") : invalid 'filename' Calls: ... in_dir -> plot2dev -> do.call -> -> png Execution halted

2
Looks like there's a percentage sign in the filename. Please try to remove it.CL.
Thanks a lot! There was a problem with the title of RMD file.Kwangi

2 Answers

5
votes

The described error also occurs, when you are knitting plots within named code chunks, and the name of the chunk does not lead to a valid path name during knitting process.

That is, during the knitting process the plots are written into a temporary path which contains the name of the code chunk, ergo this name should contain only characters that are valid for path names. One should avoid to use white characters for chunk names as well.

0
votes

I ran into the same issue. I ran this right before my first plot in the chunk and it solved it for me

dev.off()

hope this helps.