Osmar package in R “Error in file(con, ”r“) : cannot open the connection”

前提是你 提交于 2021-02-10 12:04:49

问题


I am trying to run the osmar package on my windows 10, R 3.4.2, and have correctly installed osmosis. However when I try to run the code:

>library("osmar")
>
>src <- osmsource_osmosis(file = "c:/users/ben_c/Documents/FYP/FYP_NL_Map/muenchen.osm", osmosis = "osmosis")
>
>
>nl_bbox <- center_bbox(11.575278, 48.137222, 3000, 3000)
>
>nl <- get_osm(nl_bbox, src)
>
>plot(nl)

I get the warning, after osmosis has run:

>Error in file(con, "r") : cannot open the connection
>In addition: Warning message:
>In file(con, "r") :
>  cannot open file 
>'C:\Users\ben_c\AppData\Local\Temp\Rtmp8YYPkZ\file1b182fca7802': No such file or directory

I also get the same error when I run the demo:

>demo("navigator")

I am relatively new to R so would really appreciate any help.

Thanks in advance,

Ben


回答1:


I had very similar error. I could solve the problem by running R (in my case RStudio) as administrator.

I think the problem is that a temp file can't be created.



来源:https://stackoverflow.com/questions/47137700/osmar-package-in-r-error-in-filecon-r-cannot-open-the-connection

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!