@@ -116,7 +116,9 @@ for (i in seq(along.with = products_list)) {
116
116
117
117
# # Falling pixel sampling:
118
118
raster2singlePixel <- terra :: extract(bands2stack , sampling_points ,
119
- method = " simple" , ID = TRUE ) %> % as_tibble()
119
+ method = " simple" , ID = TRUE ) %> %
120
+ as_tibble()
121
+
120
122
raster2singlePixel <- raster2singlePixel %> %
121
123
rename_at(vars(2 : (nlyr(bands2stack )+ 1 )), function (x ) paste0(x ," _pixel" ))
122
124
@@ -281,7 +283,7 @@ for (i in seq(along.with = products_list)) {
281
283
raster2samples %> % select(contains(" _" )), 1 , FUN = sum )) %> %
282
284
filter(Sum != 0 ) %> % select(- Sum ) %> %
283
285
mutate(Product = product_name ) %> %
284
- select(- contains(" ID" ))
286
+ select(- contains(" ID. " , ignore.case = FALSE ))
285
287
286
288
print(paste0(nrow(raster2samples ), " samples collected!" ))
287
289
@@ -300,7 +302,7 @@ for (i in seq(along.with = products_list)) {
300
302
raster2samples %> % select(contains(" _" )), 1 , FUN = sum )) %> %
301
303
filter(Sum != 0 ) %> % select(- Sum ) %> %
302
304
mutate(Product = product_name ) %> %
303
- select(- contains(" ID" ))
305
+ select(- contains(" ID. " , ignore.case = FALSE ))
304
306
305
307
print(paste0(nrow(raster2samples ), " samples collected!" ))
306
308
@@ -337,4 +339,3 @@ for (i in seq(along.with = products_list)) {
337
339
338
340
rm(bands2stack , raster2samples , product_bands , product_name )
339
341
}
340
-
0 commit comments