问题
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