简体   繁体   English

有没有办法将 RStudio 控制台 output 设置为完全模仿 PDF output

[英]Is there a way to set RStudio console output to exactly mimic PDF output

What I am doing is producing a document using rmarkdown and kniting to a PDF. This seems generally a great thing and produces professional looking output. However, it is really frustrating to try and tweak the look of graphics.我正在做的是使用 rmarkdown 生成文档并编织到 PDF。这通常看起来很棒,并生成专业外观 output。但是,尝试调整图形外观确实令人沮丧。 The preview looks fine in Rstudio, and then when the PDF is generated there is some issue with labels not fitting, etc.预览在 Rstudio 中看起来不错,然后在生成 PDF 时出现标签不合适等问题。

Even though my data is relatively small, and I am only producing a dozen graphs, each knit of the document takes 5 minutes or so.尽管我的数据相对较小,而且我只制作了十几个图表,但每个文件的编织需要 5 分钟左右。 That means a couple of tweaks of a graph takes 15 minutes!这意味着对图表进行几次调整需要 15 分钟!

Is there a way to set the default size of the RStudio plot window so this doesn't happen?有没有办法设置 RStudio plot window 的默认大小,这样就不会发生这种情况?

Any other tricks to speed up this process?还有其他技巧可以加快此过程吗?

Thanks,谢谢,

David大卫

Running dev.new() will open a plot window that is to your specified sizes.运行dev.new()将打开您指定大小的 plot window。

Eg dev.new(width=5, height=4)例如dev.new(width=5, height=4)

( from related question ) 来自相关问题

Else you could set the figure sizes for the chunk.否则你可以设置块的图形大小。

{r, fig.width=5, fig.height=4}  

( reference ) 参考

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM