2016-05-19 11 views
0

RMarkdownは開いたhtmlファイルを上書きしないように見えます。私は、いくつかの異なるマシンと、たくさんの異なるファイルでこれを試しました。最近の夏のように、私はhtmlドキュメントを作成し、新しいバージョンをレンダリングし、ページを更新して更新を確認することができました。Rmarkdownは、以前に上書きできなかった開いたhtmlファイルやファイルを上書きしないのはなぜですか?

さらに、開いているhtmlファイルを上書きしようとすると、それを閉じた後でも、ファイルを削除するまで更なる更新は許可されません。

考えられる解決策はありますか?エラーメッセージ

openFile: permission denied (Permission denied) 
Error: pandoc document conversion failed with error 1 
+0

私はrmarkdownでgithubの問題として提起しましたが、ファイルの書き込み権限を持つローカルの問題であると考えました。https://github.com/rstudio/rmarkdown/issues/699#issuecomment-220360925 –

答えて

0

library(rmarkdown) 

# set up to allow the use of a different directory 
directory <- getwd() 
write(' ## Testing what comes out ', file = paste(directory, "nonsense.rmd", sep="")) 

render(paste(directory, "nonsense.rmd", sep=""), output_format="html_document", 
     output_file="openPageBeforeRe-runningRender.html", output_dir = directory) 

# open url 
browseURL(paste(directory, "openPageBeforeRe-runningRender.html", sep="")) 

# re-run render with document open 
render(paste(directory, "nonsense.rmd", sep=""), output_format="html_document", 
     output_file="openPageBeforeRe-runningRender.html", output_dir = directory) 

# close document and re-run render 
render(paste(directory, "nonsense.rmd", sep=""), output_format="html_document", 
     output_file="openPageBeforeRe-runningRender.html", output_dir = directory) 

# even with the document now closed it appears to be permanently unable to write updates to the html file 

# once you remove the file you're allowed to write it again 
file.remove(paste(directory, "openPageBeforeRe-runningRender.html", sep="")) 
render(paste(directory, "nonsense.rmd", sep=""), output_format="html_document", 
     output_file="openPageBeforeRe-runningRender.html", output_dir = directory) 

の部分は、それは権限で行うことであることが判明しました。それは完全にはわかっていませんが、私は読み取りと書き込みのアクセス権を持っている間、私は今は削除許可を持っていなかったかもしれないし、問題は解決しているかもしれません。

関連する問題