I have a plain R script, not written using R Markdown. In it I create several graphs using ggplot. I then knit the script via File > Knit Document.
I have two problems with the output. First, the plots are not as wide as the rest of the output. Second, the resolution of the plots is not very good.
Is there any way I can increase the width and resolutions of the graphs without having to rewrite the script using R Markdown?
You can use the knitr spin
syntax to provide chunk options for your plots. This should increase their width (and probably also fix the resolution issue):
#+ fig.width = 3
plot(1) # narrow plot
#+ fig.width = 9
plot(1) # wide plot