I found that the hard-coded lines pdf(file = NULL) and dev.off() before and after the heatmap_motor call cause a big issue when being in a knitting + PDF context. That is, when calling pdf() before calling pheatmap, the hard-coded pdf() messes up the knitting and causes unwanted and hard to understand behavior. By removing these two lines, I was able to successfully work with pheatmap and pdf both inside and outside of Rmds.
I propose to change this and provide a fix to it soon, thank you! It seems easy to fix :)
I found that the hard-coded lines
pdf(file = NULL)
anddev.off()
before and after theheatmap_motor
call cause a big issue when being in a knitting + PDF context. That is, when calling pdf() before calling pheatmap, the hard-coded pdf() messes up the knitting and causes unwanted and hard to understand behavior. By removing these two lines, I was able to successfully work with pheatmap and pdf both inside and outside of Rmds.I propose to change this and provide a fix to it soon, thank you! It seems easy to fix :)
I can provide more details if needed.