2017-02-17 2 views
1

私はとknitrから始めています。 RStudioが提供するサンプルドキュメントでは、render()を使用してChromeで正常に表示されるHTMLファイルを生成できます。しかし、私はknitボタンをクリックしたとき、それは.markdownファイルを生成し、プレビューをレンダリングすることなく、次のエラーが返されます。レンダー()はHTMLファイルを正常に作成しますが、RSTudioでKnitr HTMLプレビューが失敗します

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

は、私はそれがpandoc段階でハングアップばかりだと思います。 RStudioが間違った場所でpandocを探している可能性はありますか? PandocはすでにC:\Program Files (x86)\Pandoc\pandoc.exeにインストールされていましたが、RSTudioはC:\Program Files\RStudio\bin\pandoc\pandoc.exeに独自のインスタンスをインストールしていますので、間違った場所や設定を混乱させている可能性があります。

ご協力いただければ幸いです。ありがとう!

そして、念のために、ここで私が始まるよRMarkdownテンプレートだ:

--- 
title: "Monthly Report" 
author: "Kris Shaffer" 
date: "February 17, 2017" 
output: html_document 
--- 

```{r setup, include=FALSE} 
library(knitr) 
knitr::opts_chunk$set(echo = TRUE) 
``` 

## 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} 
summary(cars) 
``` 

## Including Plots 

You can also embed plots, for example: 

```{r pressure, echo=FALSE} 
plot(pressure) 
``` 

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

1.3 rmarkdown knitr 1.15.1
pandoc 1.17.2(両方のインストール)

答えて

0

ファイル拡張子と同じくらい簡単でした。ファイル名をreport.rmarkdownからreport.Rmdに変更しました。ニットは今、うまく動作します。

関連する問題