将rmd文件编织为pdf时出错

时间:2017-02-17 18:34:56

标签: r pdf knitr

由于此错误,我无法编辑我的rmd文档:

title: "R two"
author: "Minoo "
date: "Monday, February 13, 2017"
output:
  pdf_document: default
  html_document: default

处理文件:R_two.Rmd

  |...                                                              |   4%
  ordinary text without R code

  |.....                                                            |   8%
label: unnamed-chunk-1
  |........                                                         |  12%
  ordinary text without R code

  |...........                                                      |  17%
label: unnamed-chunk-2
  |..............                                                   |  21%
  ordinary text without R code

  |................                                                 |  25%
label: unnamed-chunk-3
  |...................                                              |  29%
  ordinary text without R code

  |......................                                           |  33%
label: unnamed-chunk-4
  |........................                                         |  38%
  ordinary text without R code

  |...........................                                      |  42%
label: unnamed-chunk-5
  |..............................                                   |  46%
  ordinary text without R code

  |................................                                 |  50%
label: unnamed-chunk-6
  |...................................                              |  54%
  ordinary text without R code

  |......................................                           |  58%
label: unnamed-chunk-7
  |.........................................                        |  62%
  ordinary text without R code

  |...........................................                      |  67%
label: unnamed-chunk-8
  |..............................................                   |  71%
  ordinary text without R code

  |.................................................                |  75%
label: unnamed-chunk-9
  |...................................................              |  79%
  ordinary text without R code

  |......................................................           |  83%
label: unnamed-chunk-10
  |.........................................................        |  88%
  ordinary text without R code

  |............................................................     |  92%
label: unnamed-chunk-11
  

shell.exe(url)出错:' .report / report.html'找不到电话:   ... withVisible - > eval - > eval - > browseURL - > shell.exec   执行暂停

有什么想法解决它吗? 我使用R-3.3.2版本和RStudio-1.0.136版本。

2 个答案:

答案 0 :(得分:0)

以这种方式编辑它应该可以正常工作

title: "R two"
author: "Minoo "
date: "Monday, February 13, 2017"
output:
  pdf_document: default

答案 1 :(得分:0)

我再次检查了我的代码,以rmd格式找不到任何错误,当我想将其转换为pdf或HTML格式时,就会发生此错误。在我的代码的一部分,我有这个 库(" ReportingTools&#34)

htmlRep <- HTMLReport(shortName="report", title="My report",
                      reportDirectory="./report")
publish(resOrderedDF, htmlRep)
url <- finish(htmlRep)
browseURL(url)

因此,通过此代码,它需要在浏览器中打开一个页面。我删除了这一行

browseURL(url)

代码并尝试再次转换rmd文件,这次没有发生。