Skip to content

Instantly share code, notes, and snippets.

@scw
Created April 13, 2012 06:27
Show Gist options
  • Save scw/2374373 to your computer and use it in GitHub Desktop.
Save scw/2374373 to your computer and use it in GitHub Desktop.
Check raster dimensions match expectation
checkRaster <- function(raster) {
if (raster@nrows * raster@ncols == 220106) {
message <- paste("Raster size checks out for layer:", raster@layernames, sep="")
}
else {
message <- paste( "invalid raster dimensions; nrows:", raster@nrows, " ncols:", raster@ncols, sep="")
}
print(message)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment