Cannot open the connection in raster R

你。 提交于 2019-12-24 07:18:18

问题


I used these functions several times, and they were working perfect, nothing wrong with my input data!!

m<-raster::intersect(raster,shapefile)

or

n<-crop(raster, extent(shapefile))

I have to do this operation for a large set of data. Therefore, I tried to increase the speed of R by using multicore. I did use multicore.tabulate.intersect function from here

However, nothing works for me. Then, whenever I run intersect or crop function I got this error:

m<-raster::intersect(raster,shapefile)

Error in file(fn, "rb") : cannot open the connection
In addition: Warning message:
In file(fn, "rb") :
  cannot open file '/private/var/folders/57/dn1sv79j3zzgy01h2l9v89v80000gn/T/Rtmpg5AYsm/raster/r_tmp_2018-01-23_235923_1432_19427.gri': No such file or directory

> n<-crop(raster, extent(shapefile))

Error in file(fn, "rb") : cannot open the connection
In addition: Warning message:
In file(fn, "rb") :
  cannot open file '/private/var/folders/57/dn1sv79j3zzgy01h2l9v89v80000gn/T/Rtmpg5AYsm/raster/r_tmp_2018-01-23_235923_1432_19427.gri': No such file or directory

I deleted R and reinstalled it, nothing changed the problem!!

I tried to reinstall raster package and I feel R couldn't find it:

install.packages("raster")'

The downloaded binary packages are in
    /var/folders/57/dn1sv79j3zzgy01h2l9v89v80000gn/T//RtmpKDG7bH/downloaded_packages

Again try intersect

    m<-raster::intersect(raster,shapefile)

Error in file(fn, "rb") : cannot open the connection
In addition: Warning message:
In file(fn, "rb") :
  cannot open file '/private/var/folders/57/dn1sv79j3zzgy01h2l9v89v80000gn/T/Rtmpg5AYsm/raster/r_tmp_2018-01-23_235923_1432_19427.gri': No such file or directory 

Appreciate any ideas!!

来源:https://stackoverflow.com/questions/48433790/cannot-open-the-connection-in-raster-r

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