我的问题在标题中作了解释。我试着编译了一个示例.Rmd :除了在线查找各种资源外,http://www.ssc.wisc.edu/~hemken/Stataworkshops/Stata%20and%20R%20Markdown/也没有用。虽然我的资源,Doug,能够编译一个RMarkdown,但我得到了下面的MWE错误。
妇女权利委员会是:
---
title: "Stata and R Markdown (Windows)"
author: "Doug Hemken"
date: "July 2015"
output:
html_document:
toc: yes
---
```{r, echo=FALSE, message=FALSE}需要(针织品)
statapath <- "/Applications/Stata/Stata.app“
opts_chunk$set(engine="stata",engine.path=statapath,comment="")
### Descriptive Statistics
A simple example.
```{r}综合汽车
总结
来自RStudio控制台的输出/错误是:
processing file: stata.Rmd
|................ | 25%
ordinary text without R code
|................................ | 50%
label: unnamed-chunk-1 (with options)
List of 2
$ echo : logi FALSE
$ message: logi FALSE
Loading required package: knitr
|................................................. | 75%
ordinary text without R code
|.................................................................| 100%
label: unnamed-chunk-2
running: /Applications/Stata/Stata.app -q -b stata47b9d14e1c.do
Quitting from lines 20-22 (stata.Rmd)
Error in engine(options) :
sh: /Applications/Stata/Stata.app: is a directory
Calls: <Anonymous> ... process_group.block -> call_block -> block_exec -> in_dir -> engine
In addition: Warning message:
running command ''/Applications/Stata/Stata.app' -q -b stata47b9d14e1c.do 2>&1' had status 126
Execution halted发布于 2015-09-20 14:59:36
链接到的页面指向此页。这里写着:“例如,如果Stata安装在/Applications/ Stata /中,那么Stata可执行文件的路径是/Applications/Stata/Stata.app/Contents/MacOS/",,它们为Stata的所有不同口味提供了适当的链接。另外,您需要引用可执行文件,而不是它所在的文件夹。如果我按下面的方式更改您的MWE,则一切都适合我(请注意,我使用的是Stata-SE;您可能需要对您的系统进行更改)。
---
title: "Stata and R Markdown (Windows)"
author: "Doug Hemken"
date: "July 2015"
output:
html_document:
toc: yes
---
```{r, echo=FALSE, message=FALSE}需要(针织品)
statapath <- "/Applications/Stata/StataSE.app/Contents/MacOS/stata-se“
opts_chunk$set(engine="stata",engine.path=statapath,comment="")
### Descriptive Statistics
A simple example.
```{r}综合汽车
总结
https://stackoverflow.com/questions/32581867
复制相似问题