Subset spatRaster layers; return layers that match subset names, ignore those that do not?

I’m looping through rasters and would like to select a subset of layers if they match certain layer names that I’m looking for. When using terra::subset, an error will occur if a layer name is specified that does not exist in the raster. Is there a way to just return layer names that match and… Read More Subset spatRaster layers; return layers that match subset names, ignore those that do not?

Create a value associated with a member of each list and store it with that member in R

I have a list of many dataframes, all of the same format. For each member of this list, I would like to generate a spatial extent, and store it with that dataframe (this data is all lat/long data, and I am using functions from the terra package to analyze it). I am not super experienced… Read More Create a value associated with a member of each list and store it with that member in R

view Terraform output from module using for_each and toset

i have a simple terraform script which makes use of a module, the script creates multiple s3 buckets: main.tf: variable "bucket_name"{ type = list description = "name of bucket" } module "s3" { source = "../modules/s3" for_each = toset(var.bucket_name) bucket_name = "${each.key}" } outputs.tf output "arn" { description = "ARN of the bucket" value =… Read More view Terraform output from module using for_each and toset