Error in file(x, "rb") : cannot open the connection


#1

I am new to R and am trying to deploy a Code that was developed in R 3.2.3 but it is giving me the following error.

Error in file(x, "rb") : cannot open the connection

Any suggestions on how to work around this.
Currently using R version 3.5.2 with windows 10 operating system

Load the saved raster stack into R <=============

stk.save <- stackOpen("01June2016_RS3_RasterStackOut.stk")
Error in file(x, "rb") : cannot open the connection


#2

That message generally means that that either you don't have write privileges to the file or that you have the file open in another application and thus cannot write to it.

On a separate note, R 3.2.3 is very old. You should consider upgrading (3.5.3 has just been released).


#4

Thank you.
I discovered that the location of the rasters has been changed and as a result, the raster stack is no longer valid.