Closed nkruskamp closed 2 years ago
I think would probably be a bigger change than just adding a few lines based on the way the code is written between checks and configuration, but an example would be to replace this section:
with something like this:
ras_files_exist <- sapply(raster_file_list, function(x) {
exists <- file.exists(x)
if (!exists) {
print(paste(x, exists))
}
return(exists)
})
stopifnot(ras_files_exist, "file doesn't exist")
During preliminary checks (particularly in my case those related to files not existing), stop execution and throw an error instead of returning a string.