Reputation: 13
I am pretty new to knitr and I have been developing by coding a chunk at at time and running each chunk. The project is getting different sets of data from SQL server and creating ggplots.
Each chunk runs fine by itself and graphs barplots are displayed, however, when I knit the pdf, some of the same barplots are only displaying the legend and the axis labels. The image on the left is when the chunks are run one at a time. The one of the left when the document is knitted.
Is there a generic reason why running the chunks independently is different than knitting?
Upvotes: 1
Views: 1083
Reputation: 13
My earlier plot chunks were not the same as the later ones.
Evidently I had pasted my plot code into a chunk setup originally for a table. Once I removed results = "asis" , the plots rendered correctly when knitted.
Upvotes: 0
Reputation: 473
you need to make sure your data is in the right location 'same where u r saving the Markdown file'. Knitr directory is different that the one u r running from console.
Upvotes: 1