在RStudio中,编织降价输出位于何处? [英] In RStudio, where is knitr markdown output located?

查看:86
本文介绍了在RStudio中,编织降价输出位于何处?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我最近在Win10中将RStudio升级到最新版本(1.3.959).

I recently upgraded RStudio to latest version (1.3.959) in Win10.

knit选项设置为当前文件夹:

The knit option is set to current folder :

当我将Markdown文档编织为HTML时,这出乎意料地在一个临时目录中发生(例如:'Temp \ RtmpOa3xSM \ preview-11e8c6644fdd.dir \'目录).

When I knit a Markdown document to HTML, this surprisingly happens in a temporary directory (for example : 'Temp\RtmpOa3xSM\preview-11e8c6644fdd.dir\' directory).

据我所记得,在以前的版本中不是这种情况:编织将发生在我在选项中选择的目录中.

As far as I can remember, this wasn't the case in previous versions : the knit would happen in the directory I selected in the options.

选项当我关闭HTML预览时,HTML文档消失了.

When I close the HTML preview, the HTML document disappears.

我发现保留HTML文档的唯一解决方案是在浏览器中打开文档并从中保存它.

The only solution I found to keep the HTML document is to open the document in a Browser and to save it from there.

Bug还是我想念什么? 感谢您的帮助!

Bug or am I missing something? Thanks for your help!

其他Win 10用户向我报告了相同的问题

other Win 10 users reported to me the same problem

推荐答案

在某些条件下,RStudio将编织的(HTML或PDF)文件移动到临时目录(位于tempdir()下).这些条件是:

Under certain conditions, RStudio moves the knitted (HTML or PDF) file to a temporary directory (located under tempdir()). These conditions are:

  • 您正在RStudio项目中.
  • 项目构建工具"设置为包装".
  • RMD文件位于子目录vignettes中.
  • 编织从编织"开始.按钮.
  • You are in a RStudio Project.
  • The "Project build tools" are set to "Package".
  • The RMD file is located in a subdirectory vignettes.
  • Knitting is initiated with the "Knit" button in RStudio.

通常,这种情况在编织包装小插图时会发生,其目的是让您的小插图文件夹变得不整洁HTML文件" .

Typically, this happens when knitting a package vignette and has the purpose of "keep[ing] your vignettes folder from becoming cluttered with HTML files".

更改项目生成工具,更改文件夹名称或关闭项目可防止此行为.保留生成的(HTML或PDF)文件的另一种方法是交互式调用rmarkdown::render(尽管这是并不完全等效到编织"按钮).

Changing the Project build tools, changing the folder name or closing the project prevents this behavior. Another way to keep the generated (HTML or PDF) file is to call rmarkdown::render interactively (although this is not exactly equivalent to the "Knit" button).

请注意,这仅影响生成文件的保存位置.编织时的工作目录不受影响.

Note that this only affects where the generated file will be saved. The Working Directory while knitting is unaffected.

这篇关于在RStudio中,编织降价输出位于何处?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆