E.Ortiz
E.Ortiz

Reputation: 11

How can I fix “Error: Failure during raster IO”?

I'm trying to working with 12 high resolution LANDSAT images at 30m resolution (1.4 Gb per image) as covariates in a species distribution model. But I get the following error: “Error: Failure during raster IO” when extracting values from my raster stack.

library(raster)
preds <- suppressWarnings( raster::stack(files))
envtrain <- extract(preds, train)

I read some suggestion to reduce the images area, but it's not good for me.

Upvotes: 1

Views: 2538

Answers (1)

Robert Hijmans
Robert Hijmans

Reputation: 47081

This almost certainly means that your raster file is corrupted. Try downloading it again. And why do you use suppressWarnings. Remove that and look at the warnings... (and show them to us!)

Upvotes: 2

Related Questions