I am currently working on some raster models. My code has generated about 4k models (all .tif files), but about 10% of these cannot be opened using load("insert path")
. I have tried readr()
, readRDS()
and source()
, none of which worked. I have also reran some models but it didn't fix the problem. Why can't I load my .tif files?
load("comparison/mc45bi50/ni1130region33.tif")
Error in load("comparison/mc45bi50/ni1130region33.tif") : bad restore file magic number (file may be corrupted) -- no data loaded In addition: Warning message: file ‘ni1130region33.tif’ has magic number 'II*' Use of save versions prior to 2 is deprecated
source("comparison/mc45bi50/ni1130region33.tif")
Error in source("comparison/mc45bi50/ni1130region33.tif") :
comparison/mc45bi50/ni1130region33.tif:2:0: unexpected end of input 1: II*