Skip to content

Commit

Permalink
Update dynamic_proj_covariates.R
Browse files Browse the repository at this point in the history
  • Loading branch information
r-a-dobson committed Oct 5, 2023
1 parent 0f22eb4 commit fd9fad0
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion R/dynamic_proj_covariates.R
Original file line number Diff line number Diff line change
Expand Up @@ -536,7 +536,12 @@ dynamic_proj_covariates <- function(dates,
if (!missing(local.directory)) {
fileimport <- directoryfiles[grep(name, directoryfiles)]
fileimport <- fileimport[grep(date, fileimport)] # Select files
fileimport <- fileimport[!grepl("unprocessed", fileimport)] # Select files
fileimport <- fileimport[grepl(".tif", fileimport)] # Select files
fileimport <- fileimport[!grepl("unprocessed.tif", fileimport)] # Select files

if (length(fileimport) > 1) {
stop("More than one raster with date and varname in local directory")
}
raster <- terra::rast(fileimport) # Read raster from local dir
terra::crs(raster) <- prj # Check that projection is set
}
Expand Down

0 comments on commit fd9fad0

Please sign in to comment.