Rmarkdown参数化报告 - 无法访问所选文件中的数据

时间:2016-04-29 11:45:38

标签: rstudio knitr r-markdown

我遇到与上一篇文章(How do I access the data from a file passed as parameters in a RMarkdown document?)中定义完全相同的问题,而且我找不到(StackOverflow,google ...)解决问题的任何线索!

使用默认文件名,它可以工作!使用所选文件(可能是同一个文件),我收到错误。

Quitting from lines 51-51 (WBD_MCS.Rmd) 
Error in file(file, "rt") : cannot open the connection
Calls: <Anonymous> ... withVisible -> eval -> eval -> read.csv2 -> read.table -> file
In addition: Warning message:
In file(file, "rt") :
  cannot open file 'C:\Users\SESA40~1\AppData\Local\Temp\RtmpaMmix8/a6232463beeca55dd111a939/0': No such file or directory
Execution halted

我在MacOSX和Windows上遇到了问题。

R version 3.2.5 (2016-04-14) -- "Very, Very Secure Dishes"
Copyright (C) 2016 The R Foundation for Statistical Computing
Platform: i386-w64-mingw32/i386 (32-bit)

如果有人可以分享解决方案......

我的.Rmd文件的标题:

---
title: "Simulation de Monte Carlo pour une estimation Wideband Delphi"
author: "Alain BRET"
date: "28 avril 2016"
output:
  pdf_document:
    includes:
      before_body: tex/tex_before_body.tex
      in_header: tex/tex_header.tex
    number_sections: yes
    toc: yes
  html_document:
    number_sections: yes
    toc: yes
  word_document:
    toc: yes
params:
  nombre_occurences:
    input: slider
    label: "Nombre d'occurences:"
    max: 10000
    min: 1000
    step: 500
    value: 1000
  datafile:
    input: file
    label: 'Fichier des estimations des Experts:'
    value: data/estimation_data_2.csv
---

1 个答案:

答案 0 :(得分:2)

已向rstudio/rmarkdown#919报告此问题,并已在 rmarkdown 程序包的1.7版中修复此问题。它应该足够install.packages('rmarkdown')