R中的Osmar包“文件错误(con,“r"):无法打开连接" [英] Osmar package in R "Error in file(con, "r") : cannot open the connection"

查看:119
本文介绍了R中的Osmar包“文件错误(con,“r"):无法打开连接"的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试在我的 Windows 10 R 3.4.2 上运行 osmar 包,并且已经正确安装了 osmosis.但是,当我尝试运行代码时:

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")

我对 R 比较陌生,所以非常感谢您的帮助.

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

提前致谢,

推荐答案

我有非常类似的错误.我可以通过以管理员身份运行 R(在我的例子中是 RStudio)来解决这个问题.

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.

这篇关于R中的Osmar包“文件错误(con,“r"):无法打开连接"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆