首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >在RStudio中Knitr HTML预览失败,尽管render()成功创建了HTML文件

在RStudio中Knitr HTML预览失败,尽管render()成功创建了HTML文件
EN

Stack Overflow用户
提问于 2017-02-17 23:39:42
回答 1查看 816关注 0票数 4

我开始使用rmarkdownknitr了。在RStudio提供的示例文档中,我可以成功地使用render()生成一个在Chrome中显示良好的超文本标记语言文件。但是,当我单击knit按钮时,它会生成一个.markdown文件,然后返回以下错误,而不呈现预览:

Error generating HTML preview for ~/path/to/file/report.rmarkdown system error 2 (The system cannot find the file specified)

我认为它在潘多克阶段被搁置了。有没有可能RStudio在错误的地方寻找潘多克?Pandoc已经在C:\Program Files (x86)\Pandoc\pandoc.exe上安装了,但RStudio在C:\Program Files\RStudio\bin\pandoc\pandoc.exe上安装了自己的实例,所以可能它在错误的位置查找和/或混淆了一个和另一个的设置?

任何帮助都将不胜感激。谢谢!

为了以防万一,这里是我开始使用的RMarkdown模板:

代码语言:javascript
运行
复制
---
title: "Monthly Report"
author: "Kris Shaffer"
date: "February 17, 2017"
output: html_document
---

```{r setup, include=FALSE}

库(Knitr)

knitr::opts_chunk$set(echo =真)

代码语言:javascript
运行
复制
## R Markdown

This is an R Markdown document. Markdown is a simple formatting syntax for authoring HTML, PDF, and MS Word documents. For more details on using R Markdown see <http://rmarkdown.rstudio.com>.

When you click the **Knit** button a document will be generated that includes both content as well as the output of any embedded R code chunks within the document. You can embed an R code chunk like this:

```{r cars}

摘要(汽车)

代码语言:javascript
运行
复制
## Including Plots

You can also embed plots, for example:

```{r pressure, echo=FALSE}

绘图(压力)

代码语言:javascript
运行
复制
Note that the `echo = FALSE` parameter was added to the code chunk to prevent printing of the R code that generated the plot.

R版本3.3.2

RStudio 1.0.136

rmarkdown 1.3

针织1.15.1

pandoc 1.17.2 (两个安装)

EN

回答 1

Stack Overflow用户

发布于 2017-02-18 00:07:06

事实证明,它和文件扩展名一样简单。我将文件名从report.rmarkdown更改为report.Rmd。编织现在可以正常工作了。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/42301881

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档