Replace colours in a native raster

nr_replace(nr, old, new)

Arguments

nr

nativeRaster

old

Vector of old colours

new

Vector of replacement colours

Value

Original nativeRaster modified in-place

Examples

nr <- nr_new(10, 10, 'hotpink')
nr_replace(nr, 'hotpink', 'grey80')
plot(nr)