我有一张地图传单,我想将其保存在特定文件夹中的 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)
作为错误消息,根据 Rstudio 会话,我要么有
1) setwd(dir) 中的错误:无法更改工作目录
2) 找不到路径
当我只保存这样的:
library(htmlwidgets)
saveWidget(map_leaflet, file="test.html")
它完美地工作。
预先感谢您的帮助。