I want to produce a .png of a raster with background values plotted as white space.
Below you can see the current state of the plot.
As you can tell, the pixels which should contain NA values, in fact register as a single value of 94. The issue is that running a simple replace via
r[ r== 94] <- NA would also conceivably replace points within the raster. Also it's a 21GB raster, so this method would be computationally onerous.
I've produced four other .pngs from the same raster stack without this issue, as
png(raster.png); plot(raster); dev.off() automatically produced white space for background values. Do you have any other suggestions for dealing with this, outside of a crop or something in photoshop?