In the script "./scripts/rasterize_polygons.R" we convert the chlorophyll raster to a polygon to use the function spTransform to reproject it but there is the function projectRaster which provides a direct solution without converting first to polygons to carry this calculation out. Specifically all we need is:
In the script
"./scripts/rasterize_polygons.R"
we convert the chlorophyll raster to a polygon to use the functionspTransform
to reproject it but there is the functionprojectRaster
which provides a direct solution without converting first to polygons to carry this calculation out. Specifically all we need is:Where
oceans_raster
is a raster object that is already in projected in the manner we wish to use for all of our rasters in the analysis.@EmmalineSheahan I know you're cleaning this code up so can you please introduce this change?