相关疑难解决方法(0)

来自R的htmlwidget的savewidget,无法将html文件保存在另一个文件夹中

我有一个地图传单,我想保存在特定文件夹中的html文件中.我使用的是Windows 7.

我尝试了以下方法:

library(htmlwidgets)
saveWidget(map_leaflet, file="ressources/test.html")

library(htmlwidgets)
saveWidget(map_leaflet, file="ressources\\test.html")

library(htmlwidgets)
path_name <- file.path("ressources", "test.html", fsep="\\")
saveWidget(map_leaflet, file=path_name)

library(htmlwidgets)
path_name <- paste("ressources", "test.html", sep="/")
saveWidget(map_leaflet, file=path_name)
Run Code Online (Sandbox Code Playgroud)

作为错误消息,取决于Rstudio会话,我要么

1)setwd(dir)错误:无法更改工作目录

2)找不到路径

当我只保存这样:

library(htmlwidgets)
saveWidget(map_leaflet, file="test.html")
Run Code Online (Sandbox Code Playgroud)

它完美地运作.

预先感谢您的帮助.

html r save htmlwidgets

13
推荐指数
1
解决办法
5075
查看次数

标签 统计

html ×1

htmlwidgets ×1

r ×1

save ×1