# masks the image to the extent of the shapefile (product to be masked, shapefile used) dNBR_masked <- mask(dNBR,Empedrado) # crops the image to the extent of the shapefile (product to be masked, shapefile used) dNBR_cropped <- crop(dNBR_masked,Empedrado) # plots the cropped image plot(dNBR_cropped)