我正试图创建一个“实时”网站,其中index.html文件上的Plotly图不断更新。为此,我使用以下函数在R中创建了Plotly图的html。但是,在创建html文件之后,我似乎无法运行该行,并且无法找到覆盖现有html文件的方法。
htmlwidgets::saveWidget(as_widget(file), "destination/filename.html")
如果文件名已经存在,这是错误:
Error in normalizePath(path.expand(path), winslash, mustWork) :
path[1]="graph2_files/htmlwidgets-1.3": Access is denied
In addition: Warning messages:
1: In dir.create(target_dir) :
cannot create dir 'graph2_files\htmlwidgets-1.3', reason 'Permission denied'
2: In file.create(to[okay]) :
cannot create file 'graph2_files/htmlwidgets-1.3/htmlwidgets.js', reason 'Permission denied'