R-markdown无法更改工作目录。用于正常工作

时间:2019-01-26 01:24:28

标签: r r-markdown knitr

我有用于笔记本电脑正常工作的R-markdown代码。我只是运行我的代码,并收到以下错误。我尝试重新安装knitr和markdown软件包,但问题仍然存在。这是错误:

  

无法更改工作目录   调用:... withCallingHandlers-> withVisible-> eval-> eval-> setwd   执行停止

这是我代码的前几行:

---
output: 
  html_document:
  toc: true
  number_sections: true
geometry: margin= 0in
include:
 after_body: footer.html
---

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

```{r, echo=FALSE, warning = FALSE, message=FALSE}
#Edit theses values to change it throughout the report
county<-"Butler"
pubDate<- "June 2018"
citeDate<-"2013"
```
```{r, echo=FALSE, warning = FALSE, message=FALSE}

1 个答案:

答案 0 :(得分:1)

我不确定发生了什么,但是当我重新运行代码时,我不再收到该错误。相反,我收到此错误:错误:必须提供符号或字符串作为参数。我认为代码的以下部分应该有问题:
  education.year <-acs%>%   filter(Sex ==“总计”,Age Group ==“全部”,County Name ==县)%>%   选择(6th Grade or Less7th- 12th (No Diploma)High School Graduate,          Some CollegeBachelor's DegreeGraduate Degree)%>%   收集(c({6th Grade or Less7th- 12th (No Diploma)High School Graduate,            Some CollegeBachelor's DegreeGraduate Degree),EduPerc)

P.S:我的Rmarkdown代码以前可以正常工作。