We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent c2b7b51 commit 0bbbb7bCopy full SHA for 0bbbb7b
1 file changed
02_Covariates_Extraction.R
@@ -90,12 +90,10 @@ raster_list
90
#Stack all unique covariates
91
raster_2024_covariates <- rast(paste0(covs_path_2024, c(raster_list)))
92
93
-# Find duplicate layer names
94
-dup_names <- names(raster_2024_covariates)[duplicated(names(raster_2024_covariates))]
+names(raster_2024_covariates) <- sources(raster_2024_covariates) %>%
+ lapply(str_split_i, "/", -1) %>%
95
+ lapply(str_split_i, ".tif", 1)
96
-# Remove layers with duplicate names (keep only the first occurrence)
97
-unique_layers <- !duplicated(names(raster_2024_covariates))
98
-raster_2024_covariates <- raster_2024_covariates[[unique_layers]]
99
100
#Extract rasters using their mean values
101
tic()
0 commit comments