A nativeRaster in R looks like an integer matrix, but is interpreted different by graphics devices:

nr_new(width, height, fill = "white")

Arguments

width, height

Image dimensions in pixels

fill

Background fill color as a character string. Either a standard R color or a hex colour of the form #rrggbbaa or #rrggbb

Details

  • The data should be treated as RGBA pixels in row-major ordering

  • Each 32-bit integer should be interpreted as 4-bytes - one for each of the R, G, B and A colour channels